ตารางโล่ UI รับข้อมูลแถวที่เลือก

ฉันกำลังพยายามรับข้อมูลแถวที่เลือกเป็นวัตถุ JSON จากตาราง Shield UI ฉันลองด้วย นี่และนี้ ตัวอย่างที่ให้ไว้ในเอกสารของพวกเขา .แต่ไม่ได้ทำงานตามความจำเป็น grid.select() ให้ฉัน TypeError: c.value is not a function และ grid.selectedRowIndices() ให้ 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());

ความช่วยเหลือใด ๆ ที่จะเห็นคุณค่าขอขอบคุณ


person Madushan Perera    schedule 08.06.2016    source แหล่งที่มา


คำตอบ (1)


หากต้องการรับรายการที่เลือกในตาราง คุณสามารถใช้ SelectedRowIndeces ตามที่อธิบายไว้ที่นี่: http://www.shieldui.com/documentation/grid/javascript/api/methods/selectedRowIndices ตรวจสอบให้แน่ใจว่าคุณใช้วิดเจ็ตเวอร์ชันล่าสุด

person Yavor Angelov    schedule 09.06.2016