According to Tony's response to me in this post, the results should already be returned in the form of a comma separated string (hence the use of explode to convert to an array).
This sounds like a problem that I see sometimes when I have a mismatched number of columns defined in colModel versus cells returned in xml.
Do you know for sure that there is a match between defined grid columns and what is being returned in xml (assuming xml here, I don't do json, but figure it would behave the same way)?
Check this post from me awhile back – Tony gives the solution.
Hi Praveen, do want to change it permanently/globally, as in grid.locale-.js?
Genti, use setCell (see Basid Grids > Methods in docs for more information).
Thanks Tony!
3.5 Alpha 3 is available now and seems very solid, so far as I have tested – I'm using a fair amount of the 3.5 feature/functionality and am happy that I made the decision in lieu of 3.4.
Tony, thanks so much for the fixes in Alpha 3 – formedit modal's are working great!
I'm glad that you got it working – I've seen several theads lately concerning pointers/tutorials needed on this topic.
I am traveling now, but let me try to look at this tomorrow – I made an assumption that you were able to see data…if you add data (via phpMyAdmin, or some other way) directly into the table (invheader?), does it get returned to the grid?
I ran into this about a week ago – Tony provided the solution in this thread:
I “fixed” it with a hack, posted in the same thread.
Thanks Tony, that sounds good to me!
Here's a santized example of a working grid that I'm using from which I add/edit/delete records – I've gotten into the habit of explicitly defining the url that the add, edit, and del operations will be using – usually because I'm passing a bunch of extra stuff (and therefore, mostly forcing GET, but that's a different story).
jQuery(document).ready(function(){
jQuery("#users_tbl").jqGrid({
caption: 'Users',
colModel :[
{name:'uid', index:'uid', width:40, align:'center',editable:false,editoptions:{readonly:true,size:10}},
{name:'uuser', index:'uuser', width: 100, editable:true,editoptions:{size:27}},
{name:'uname', index:'uname', width: 200, editable:true,editoptions:{size:27}},
{name:'uemail', index:'uemail', width: 200, editable:true,editoptions:{size:27},editrules:{email:true}},
],
colNames:['ID','Login','Full Name','Email'],
datatype: 'xml',
forceFit: false,
height: 220,
imgpath: '.assets/css/images',
mtype: 'GET',
pager: jQuery('#users_tbl_nav'),
rowNum:10, rowList:[10,20,30],
shrinkToFit: false,
sortname: 'uid',
sortorder: 'asc,
}).navGrid('#users_tbl_nav',
{},
{editCaption:'Edit User',
height:280,
reloadAfterSubmit:false,
url:'.assets/admin_access_usertbl.php'
},
{addCaption:'Add User',
height:280,
reloadAfterSubmit:true,
url:'.assets/admin_access_users_tbl.php'},
{caption:'Delete User',
reloadAfterSubmit:false,
url:'.assets/admin_access_users_tbl.php'},
{}
);
});
and here is the corresponding PHP
<?
require('admin_db.php');
// FETCHES THE 'USERS' TABLE DATA
if($_GET[oper]=='sel'){
<>
// ADDS NEW USER RECORD
} elseif($_POST[oper]=='add') {
It works fine for me Maik, using the same format you show above.
It's pretty easy once you understand how to setup the grid, and what a submit is trying to pass.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top