Search code examples
gridselectedindexshieldui

shield ui grid get selected row data


I m trying get selected row data as JSON object from shield ui grid.I tried with this and this examples given in their documentation.But non of them work as needed. grid.select() gives me TypeError: c.value is not a function and grid.selectedRowIndices() gives TypeError: grid.selectedRowIndices is not a function.

events: {
                selectionChanged: function (e) {
                    //var data = e.target.dataSource.view;

                    var grid = $("#user_grid").swidget();
                    //console.log(grid.selectedRowIndices());
                      console.log(grid.select());

Any help would be appreciable.Thank you.


Solution

  • To get the selected items in the grid, you can use the selectedRowIndeces, as described here: http://www.shieldui.com/documentation/grid/javascript/api/methods/selectedRowIndices Make sure that you are using the latest version of the widget.