Forum


09:58

08/09/2008

Hi. I almost finish my grid code but the navigation button keep "disabled" altough i have more data to show.
My grid definition is
jQuery("#list").jqGrid({
caption: 'Sectores',
colNames:['Codigo','Nombre'],
colModel :[
{ name: "co_sector", index: "co_sector", width: 20, editable: true, search: false },
{ name: "nb_sector", index: "nb_sector", width: 90, editable: true, editoptions: {size: "60", maxlength: "60"}, editrules:{requerided:true}}
],
datatype: "json",
editurl: urlString,
hidegrid: false,
height: "47%",
imgpath: "../js/themes/basic/images",
jsonReader: {
repeatitems : true,
id: "0"
},
loadtext: "Cargando...",
loadui: "block",
mtype: "GET",
pager: jQuery('#pager'),
recordtext: "Registros en total.",
rowNum: 10,
sortname: "nb_sector",
sortorder: "asc",
toolbar: [true, "bottom"],
url: urlString,
viewrecords: true,
width : 800,
loadError : function(xhr,st,err) {
jQuery("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
}
}).navGrid("#pager",
{}, //options
{ height:100, width:500,
reloadAfterSubmit:false
}, // edit options
{ height:280,width:300, reloadAfterSubmit:true }, // add options
{ height:90, width:300, reloadAfterSubmit:false,
beforeSubmit: function() {
var sr = jQuery("#list").getGridParam('selrow');
var rowData = jQuery("#list").getRowData(sr);
this.delData = {"co_sector" : rowData['co_sector']};
retarr = {"co_sector" : rowData['co_sector']};
return retarr;
}
}, // del options
{} // search options
).navButtonAdd("#pager", {
caption: "",
buttonimg: "../images/page_excel.png",
onClickButton: function() {
showReportWindow("excel");
},
position: "last"
}).navButtonAdd("#pager", {
caption: "",
buttonimg: "../images/page_white_acrobat.png",
onClickButton: function() {
showReportWindow("pdf");
},
position: "last"
});
And my json response is
{ total: "1",
page: "1",
records: "19",
rows :[{id: "1", cell:["11","ADMISTRACIÓN LEGAL Y FINANZAS"]},
{id: "2", cell:["4","ASEGURADORA, ARREDADORA FINANCIERA Y OTROS AFINES"]},
{id: "3", cell:["16","CAJA DE AHORRO, COOPERATIVA O AFINES"]},
{id: "4", cell:["10","CENTROS EDUCATIVOS Y AFINES"]},
{id: "5",cell:["2","COMERCIALIZADORA DE PRODUCTOS ELECTRÓDOMESTICOS, COMPUTACIÓN, MAN"]},
{id: "6",cell:["1","EDITORIAL, VENTA DE LIBROS (MAYOR O DETAL) Y AFINES"]},
{id: "7",cell:["14","EMPRESAS DE CONSULTORÍA, DESARROLLO DE SOFTWARE Y AFINES"]},
{id: "8",cell:["17","EMPRESAS DE SERVICIOS EN GENERAL"]},
{id: "9",cell:["15","FUNDACIÓN SIN FINES DE LUCRO"]},
{id: "10",cell:["9","INMOBILIARIAS, ADMINISTRADORAS DE BIENES RAÍCES Y AFINES"]}
]
}
Is there somethig I left out ?
10:30

Moderators
30/10/2007

Hello,
{ total: “1″,
page: “1″,
records: “19″,
The total propertie means total pages. If this is 1 the buttons
are disabled. Set this to appropriate value.
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:
81 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