【问题标题】:how to get data from jqgrid clientArray?如何从 jqgrid clientArray 获取数据?
【发布时间】:2015-11-12 16:28:01
【问题描述】:

嗨,我正在尝试从我的网格中获取数据,但我无法从 clientArray 获取数据我正在使用此代码我不知道如何获取数据以在获取数据之前发送到远程服务器

 var dataGridNuevaCajaMatriz = [{
                '40': 0,
                '50': 0,
                '60': 0,
                '70': 0,
                '80': 0,
                '90': 0,
                '100': 0,
                '110': 0
            }];

            jQuery("#grid_nueva_caja_matriz").jqGrid({
            data: dataGridNuevaCajaMatriz,       
            datatype: "local",
            //datatype: "json",
            loadonce: true,         
            /*height:'400',*/
            colNames:['40','50','60','70','80','90', '100', '110'],
            colModel:[
            //{name:'seleccion',index:'', width:50, align: 'center',editable: false, formatoptions: {disabled : false}, editoptions: {value:"1:0" },editrules:{required:false}},
            {name:'40',index:'40', width:50, align:"center",editable:true},
            {name:'50',index:'50', width:50, align:"center",editable:true}, 
            {name:'60',index:'60', width:50, align:"center",editable:true}, 
            {name:'70',index:'70', width:50, align:"center",editable:true}, 
            {name:'80',index:'80', width:50, align:"center",editable:true}, 
            {name:'90',index:'90', width:50, align:"center",editable:true}, 
            {name:'100',index:'100', width:50, align:"center",editable:true},
            {name:'110',index:'110', width:50, align:"center",editable:true},   
            ],
            rowNum:999999,
            pager: '#pager_nueva_caja_matriz',
            toppager:false,
            pgbuttons:false,
            pginput:false,
            rowList:false,
            gridview:false, 
            shrinkToFit: false,
            jsonReader: {
            repeatitems : false,
            cellEdit: true,
            cellsubmit : 'clientArray',
            editurl: 'clientArray', 
            },      
            loadError: function (jqXHR, textStatus, errorThrown) {
            message_error('ERROR','HTTP message body (jqXHR.responseText): ' + '<br>' + jqXHR.responseText);
            },
            //ondblClickRow
            onSelectRow: function(){
                var row_id = $("#grid_nueva_caja_matriz").getGridParam('selrow');
                jQuery('#grid_nueva_caja_matriz').editRow(row_id, true);
            }
            });

            jQuery("#form_nueva_caja_matriz #grid_nueva_caja_matriz").jqGrid('navGrid','#pager_nueva_caja_matriz',{edit:false,add:false,del:false});

如何获取数据 clienteArray 我无法获取这些。请帮我 谢谢

【问题讨论】:

  • 您想在网格中使用哪种编辑模式:单元格编辑还是内联编辑?您不能在同一个网格中使用两种编辑模式。目前,您使用cellEdit: true, cellsubmit : 'clientArray' 进行单元格编辑,并且包含行选择的editRow 的开始(请参阅onSelectRow 回调)。您在输入数据中使用了非常奇怪的列名(colModel 中的name 属性)和 no rowids(每个 for 都没有具有唯一值的 id 属性)。你的问题也不清楚。您是否需要在要获取修改后的数据以发送到服务器的页面上设置一些“保存”按钮?

标签: php jqgrid


【解决方案1】:

jqgrid 手册说如果您在"clientArray" 模式下使用它,则不需要editurl 参数。 http://www.trirand.com/jqgridwiki/doku.php?id=wiki:cell_editing

这篇较早的帖子在clientArray 模式下存在一些问题,但似乎已经解决了一些问题:What is the effect of paging on jqgrid's getChangedCells method when using clientArray(clientside) for editing?

【讨论】:

    猜你喜欢
    • 2014-07-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-20
    • 1970-01-01
    • 2012-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多