Ajax request not sent

88 views
Skip to first unread message

Kevin Cyster

unread,
Apr 13, 2012, 1:39:08 PM4/13/12
to Flexigrid for jQuery
Hi all,

I'm new to Flexigrid and I'm unable to get it to work, ie. nothing
displays on my page.

My code is as follows:

jQuery(function() {
jQuery("#grid_users").flexigrid({
type: 'POST',
url: 'index.php?module=schoolusers&action=ajaxFlexigridUsers',
dataType: 'json',
colModel: [
{display: 'ID',name: 'id',width: 200,sortable: true,align:
'left'},
{display: 'Username',name: 'username',width: 200,sortable:
true,align: 'left'},
{display: 'Title',name: 'title',width: 200,sortable:
true,align: 'left'},
{display: 'First name',name: 'firstname',width:
200,sortable: true,align: 'left'},
{display: 'Last name',name: 'surname',width: 200,sortable:
true,align: 'left'},
{display: 'Email address',name: 'emailaddres',width:
200,sortable: true,align: 'left'}
],
buttons: [
{name: 'Add',onpress: doCommand,bclass: ''},
{name: 'Edit',onpress: doCommand,bclass: ''},
{name: 'Delete',onpress: doCommand,bclass: ''},
{name: 'Display',onpress: doCommand,bclass: ''}
],
searchitems: [
{display: 'Username',name: 'username',isdefault: false},
{display: 'First name',name: 'firstname',isdefault:
false},
{display: 'Last name',name: 'surname',isdefault: true}
],
sortname: "surname",
sortorder: "ASC",
usepager: true,
title: "List users",
useRp: true,
rp: 10,
resizable: true,
showTableToggleBtn: true,
height: 500,
width: 750,
singleSelect: true
});
});


When I check the error console in firebug it shows that no ajax
request was sent.

Also ,the following code with an alert in flexigrid.js:

$.fn.flexigrid = function (p) {
alert(this.length);
return this.each(function () {
if (!docloaded) {
$(this).hide();
var t = this;
$(document).ready(function () {
$.addFlex(t, p);
});
} else {
$.addFlex(this, p);
}
});
}; //end flexigrid

gives 0;


Any help please


Regards

Kevin Cyster
Reply all
Reply to author
Forward
0 new messages