如何在createeditor函数中获取行索引

时间:2015-01-29 07:25:04

标签: javascript jqwidget

我希望我点击的行的详细信息,实际上我正在使用创建编辑器在网格列中分配下拉列表我得到了正确的但是没有正确地获取行详细信息每行给出相同的值,所以我怎样才能获得正确的行详细信息

我使用了这段代码

{
       text: 'Sort Type', dataField: 'aliasname1', columntype: 'dropdownlist', width: '11%', editable: true,

       createeditor: function (row, cellvalue, editor) {                

           var colvalue = $('#shipmentgrid').jqxGrid('getcellvalue', row, 'column');
           var tblvalue = $('#shipmentgrid').jqxGrid('getcellvalue', row, 'table');
           // construct the editor.   
           var requiredfield = ["Ascending", "Descending", "Unsorted"];
           editor.jqxDropDownList({ source: requiredfield, dropDownHeight: '80px', autoDropDownHeight: 0, selectedIndex:-1, checkboxes: true })
       }
},

1 个答案:

答案 0 :(得分:0)

行的索引作为参数传递 - 函数(行,.... 如果要根据该索引获取行的数据,可以使用getrowdata方法并将行的索引作为参数传递。