데이터 유형이 local 인 JQgrid를 만들고 getLocalRow 또는 getCell을 사용하여 행 편집에서 행 값을 가져 오려고하지만 항상 false가 표시됩니다.jqGrid getLocalRow return false
jQuery("#rowed5").jqGrid({
datatype: 'local',
data: mydata,
loadtext:"Cargando...",
height: altura*0.4,
width: anchoDefecto*0.9,
colNames:['Cuenta',
'Subcuenta',
'Importe',
'Signo',
'Clave',
'Documento',
'Doc. Referencia',
'Ampliación',
'Extensión'],
colModel:[
{name:'intIdfCuenta',index:'intIdfCuenta', width:200, sorttype:"int", editable:true,editrules:{required:true}, edittype:'custom',
editoptions:{custom_element: myelemcuentas, custom_value:myvaluecuentas} },
{name:'intIdfSubcuenta',index:'intIdfSubcuenta', width:200,editable: true,editrules:{required:true}, edittype:'custom',
editoptions:{custom_element: myelemsubcuentas, custom_value:myvaluesubcuentas}},
{name:'floatImporte',index:'floatImporte', width:200,editable: true,editrules:{required:true}, edittype:'text'},
{name:'strSigno',index:'strSigno', width:200,editable: true, edittype:'custom',editrules:{required:true},
editoptions:{custom_element: myelemsigno, custom_value:myvaluesigno} },
{name:'strIdfClave',index:'strIdfClave', width:200,editable: true,editrules:{required:true}, edittype:'custom',
editoptions:{custom_element: myelemclave, custom_value:myvalueclave} },
{name:'strDocumento',index:'strDocumento', width:200,editable: true,editrules:{required:true},edittype:'text'},
{name:'strDocumentoReferencia',index:'strDocumentoReferencia', width:200,editable: true,edittype:'text'},
{name:'strAmpliacion',index:'strAmpliacion', width:200,editable: true,edittype:'text',editoptions: {
dataInit: function (elem) { $(elem).focus(function() { this.select(); }) },
dataEvents: [
{
type: 'keydown',
fn: function (e) {
var key = e.charCode || e.keyCode;
if (key == 9)
{
procesarTabulacionAmpliacion();
}
}
}
]
}
},
{name:'strIdfTipoExtension',index:'strIdfTipoExtension', width:200,editable:true,edittype:'custom',
editoptions:{custom_element: myelemextension, custom_value:myvalueextension} }
],
cellsubmit: "clientArray",
pager:"#pager",
onSelectRow: function(id){
selectNextRow(id);
}
});
onSelectRow 기능은 다음과 같습니다 :
function selectNextRow(id){
if (lastsel!=null && id!==lastsel && !myRowIsValid(lastsel)) {
if(lastsel!=null && id!==lastsel){
jQuery('#rowed5').jqGrid('setSelection', lastsel);
}
return false;
}else if(id && id!==lastsel){
newline = '0';
jQuery("#rowed5").saveRow(lastsel, false, 'clientArray');
jQuery("#rowed5").editRow(id, false);
lastsel=id;
actsel = id;
// ponemos foco
$(getId("intIdfCuenta",actsel,true)).focus();
}
}
내가 사용 정보를 행 얻으려고 : 이 내 그리드의 정의입니다
var floatImporte = $("#rowed5").jqGrid('getCell', 'floatImporte');
var localRowData = $("#rowed5").jqGrid('getLocalRow');
그러나 두 경우에 나는 항상 false를 얻는다.
모든 솔루션?
죄송하지만 해결책은 아닙니다. 내가 사용하는 경우 : var localRowData = $ ("# rowed5"). jqGrid ('getLocalRow', 1); 동일한 결과를 얻습니다. false – Rafael
@Rafael : '1'은 jqGrid의 ID가 아닙니다. ** getLocalRow'를 사용하여 어디에서 ** 어떤 문맥을 사용하는지 명확한 곳에 코드를 게시해야합니다. 또한 간단한 테스트 데이터 ('mydata')의 게시물도 도움이 될 수 있습니다. 지금까지는 긴 코드를 게시했지만 주요 문제점 인'getLocalRow' 호출을 포함하지 않습니다. – Oleg