简体   繁体   中英

Jtable, jQuery selectionchange is not working

I am trying to select values in one table so that according to the selected value, the values in the other table changes. I am trying to achieve this using jQuery jTable. I have got the values in both the table but when I select a value in table 1, the values in the table 2 remains the same, Here my table 1 is #selecteventtype and table 2 is selecteventcode. My jQuery code for the selectionchanged is

  selectionChanged: function () {
                      var $selectedRows = $('#selecteventtype').jtable('selectedRows');
                      if ($selectedRows.length > 0) {
                          $selectedRows.each(function () {
                              var record = $(this).data('record');
                              selectedtype = record.irs_type;
                              $('#selecteventcode').jtable('load', irs_type:selectedtype );
                            console.log(selectedtype)
                          });
                      }
                  },

Can someone help me with this

Thanks

尝试

$('#selecteventcode').jtable('load', {irs_type:selectedtype} );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM