當我使用PuTTY與我的父親一起編程時,我遇到了子網格數據問題。我們用一個子網格做網格;這會收到JSON和PHP響應。我們在Mozilla的壓制和JavaScript代碼的語法中看到它。是否可以,而不是語法或語義問題?我不知道爲什麼我的jqGrid子網格不顯示數據
嗯,這是my page和我的代碼:
$(document).ready(function() {
$("#divFacturas").html("<table><tr><td><table id='grillaFac' name='grillaFac' style=' height=2500px width=100%'></table> <DIV id='pggrillaFac' name='pggrillaFac'></DIV></td></tr></table>");
var usuario = $("#usuario").val();
var clave = $("#clave").val();
creaGrillaFacturas(usuario, clave);
function creaGrillaFacturas(usuario, clave) {
jQuery("#grillaFac").jqGrid(
{
url:'ajaxFacturas.php?usuario=' + usuario + '&clave=' + clave,
datatype: "json",
colNames:['Codigo', 'Tipo', 'Fecha/hora Comprobante', 'Comprobante', 'Debito', 'Credito', 'Resumen'],
colModel:[ { name:'codigo', index:'codigo', width: 80, sorttype:'int'},
{ name:'tipo', index:'tipo'},
{ name:'fecha', index:'fecha'},
{ name:'numero', index:'numero'},
{ name:'debito', index:'debito', align: 'right', formatter:"number", summaryType:'sum' },
{ name:'credito', index:'credito', align: 'right', formatter:"number", summaryType:'sum' },
{ name:'resumen', index:'resumen', align: 'right'}
],
rowNum: 1000,
shrinkToFit: true,
forceFit:true,
loadtext: 'Cargando',
//loadonce: true,
viewrecords: true,
pager: '#pggrilla',
altRows: true,
sortname: 'codigo',
sortorder: "desc",
forceFit : true,
ignoreCase: true,
caption:"Comprobantes encontrados",
//jsonReader: { repeatitems : false, id: 'codigo',
//subgrid: {root: "rows", repeatitems: false}},
jsonReader: { repeatitems: false, id: 'codigo'},
grouping : true,
groupingView : { groupField: ['resumen'],
groupSummary: [true],
groupColumnShow: [true],
groupText: ['<b>Resumen Nro.: {0}</b>'],
groupCollapse: false,
groupOrder: ['desc']},
subGrid: true,
subGridRowExpanded: function (subgrid_id, row_id) {
var subgrid_table_id, pager_id;
subgrid_table_id = subgrid_id+"_t";
pager_id = "p_"+subgrid_table_id;
$("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
jQuery("#"+subgrid_table_id).jqGrid({
url:"subgrid.php?q=1162&id="+row_id,
dataype:"json",
colNames: ['Articulos', 'Descripcion', 'Cantidad', 'Precio unitario'],
colModel:[
{name:"articulo", index:"articulo", width:100},
{name:"detalle", index:"detalle", width:100},
{name:"cantidad", index:"cantidad", width:100},
{name:"precio", index:"precio", width:100}
],
rowNum:20,
viewrecords: true,
//pager: pager_id,
sortname:'articulo',
sortorder:"asc",
height: '100%'
});
//jQuery("#"+subgrid_table_id).jqGrid('navGrid',"#"+pager_id,{edit:false,add:false,del:false})
}
});
jQuery("#grillaFac").jqGrid('hideCol', ['codigo']);
jQuery("#grillaFac").jqGrid('navGrid', 'pggrillaFac',
{search:true, edit:false, add:false, del:false});
$("#grillaFac").setGridWidth($(window).width()-50);
$("#grillaFac").setGridHeight($(window).height()-50);
}
});
我希望你能幫助我:d。
您的意思是SSH客戶端PuTTY,意味着您正在SSH遠程計算機上工作,或者您指的是其他內容? –
SSH客戶端PuTTY是的,我用它來編輯我認爲服務器.. – tzanuttini
是的,你可能用它來連接到服務器,你在那裏做的工作......好吧,我只是想知道是否有可能是JS庫叫膩子什麼的。嗯,我想知道的另外一件事是,當你寫'depuring'時,你的意思是再寫一個字。如果是這樣的話? –