Forum


07:20

16/12/2009

Hi, firstly congratulation for the plugin and the community.
I am using Codeigniter 1.7.2 and jqGrid, but I have a problem. I also say that after reading the wiki again and again I have not been able to find a solution for my json data. The respond that I get is OK, using Firebug is the following:
POST:
_search | false |
nd | 1260940642625 |
page | 1 |
rows | 20 |
sidx | idpieza |
sord | desc |
RESPOND:
[{"idpieza":"1","descripcion":"Primera pieza de mi vida",
"fechaAlta":"2008-12-31 23:59:59","fechaMod":"2009-01-31 23:59:59",
"vista":"1","vertical":"0","width":"500","height":"400","top":"10",
"left":"20","color":"blue","background":"#efefef","border":"4px solid #A9A9A9",
"bloque_background":"#fff","usuario":"0"},{"idpieza":"2","descripcion":"Segundona",
"fechaAlta":"2009-02-27 23:59:59","fechaMod":"2009-11-0623:59:59","vista":"1",
"vertical":"1","width":"600","height":"600","top":"500","left":"300","color":"red",
"background":"white","border":"1px solid green","bloque_background":"white","usuario":"0"},........
CODE:
jQuery("#lista").jqGrid({
ajaxGridOptions : {type:"POST"},
serializeGridData : function(postdata) {
postdata.page = 1;
return postdata;
},
url:'piezas/cristina',
datatype: "json",
colNames:['ID','Descripcion', 'fechaAlta', 'fechaMod','vista','Vertical','width',
'height','top','left','color','background','border','bloque_background'],
colModel:[
{name:'idpieza',index:'idpieza', width:55},
{name:'descripcion',index:'descripcion', width:90},
{name:'fechaAlta',index:'fechaAlta', width:100},
{name:'fechaMod',index:'fechaMod', width:80, align:"right"},
{name:'vista',index:'vista', width:80, align:"right"},
{name:'vertical',index:'vertical', width:80,align:"right"},
{name:'width',index:'width', width:150, sortable:false},
{name:'height',index:'height', width:150, sortable:false},
{name:'top',index:'top', width:150, sortable:false},
{name:'left',index:'left', width:150, sortable:false},
{name:'color',index:'color', width:150, sortable:false},
{name:'background',index:'background', width:150, sortable:false},
{name:'border',index:'border', width:150, sortable:false},
{name:'bloque_background',index:'bloque_background', width:150, sortable:false}
],
rowNum:20,
width:900,
rowList:[10,20,30],
pager: '#paginacion',
sortname: 'idpieza',
viewrecords: true,
sortorder: "desc",
caption:"Piezas registradas en el sistema por el usuario"
});
jQuery("#pjqgajax").jqGrid('navGrid','#pjqgajax',{edit:false,add:false,del:false});
>I know that maybe this json is not available for jqGrid, but i am trying all possibilities. I tried different versions of the jsonReader but not successfully.
So if something is wrong, can anybody help me?
Thanks indeed.
19:42

Moderators
30/10/2007

Hello,
In this case you should configure the jsonReader - and set the option repeatitems to false.
More you can find here:
http://www.trirand.com/jqgridw.....#json_data
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
21:31

Moderators
30/10/2007

Hello,
Yes it is possible to do this. Do not forget to put the totalpages and other needed attributes for the response.
Best Reagrds
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
09:32

Moderators
30/10/2007

Hello,
Why not follow the link and see what you do wrong?
In order to understand if everthing is ok, just try with one column.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
57 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66