u012699952
zsmj1994
2017-04-26 03:18

easy ui datagrid 获取getSelections出错

5
  • easyui
  • datagrid

我在一个dialog里面放了一个datagrid,dialog加了一个button,在handler里写了$(mydatagrid).datagrid('getSelections'),
但是一直报错,报错内容问 b3 is undefined ,b3是什么鬼啊?easyui源码里的?

     $d.dialog({
                title: "下拉表格",
                // width: 500,
                // height: 320,
                id: 'newDialog',
                buttons: [{
                    text: '确认',
                    iconCls: 'icon-ok',
                    handler: function () {
                        // self._setTextAndValue();
                        //$('newDatagrid').datagrid('getSelections')

                       var rows = $('#newDatagrid').datagrid('getSelections'); //这里报错
                       console.log('选择结果' + rows);

                        $('#newDialog').dialog('destroy');
                    }
                }],
                content: $t
            });

            $t.datagrid({
                singleSelect: false,
                id: 'newDatagrid',
                idField: columns[0],
                collapsible: false,
                columns: columns,
                fitColumns: true,
                singleSelect: false,
                rownumbers: true,
                data: data,
                loadFilter: self.pagerFilter,
                pagination: true,
                onClickRow: function (rowIndex, rowData) {
                    self._setTextAndValue(rowData[opt.textColumnName], rowData[opt.valueColumnName]);
               //     console.log($('#newDatagrid').datagrid('getSelections'));
                }
            });
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答