Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery EasyUI DataGrid - Getting Selected Row Data

jQuery EasyUI DataGrid - Getting Selected Row Data

This example demonstrates how to get the selected row data.

The datagrid component includes two methods to retrieve selected row data:

Create the DataGrid



    

        

            

                

                

                

                

                

                

            

        

    
Item IDProduct IDList PriceUnit CostAttributeStauts

Usage example

Get the selected row data:



    var row = $('#tt').datagrid('getSelected');

    if (row){

        alert('Item ID:'+row.itemid+"\nPrice:"+row.listprice);

    }

Get the itemid of all selected rows:



    var ids = [];

    var rows = $('#tt').datagrid('getSelections');

    for(var i=0; i

Download the jQuery EasyUI example

jeasyui-datagrid-datagrid3.zip