jquery - Dependent columns using hansontable plugin -


i using jquery handsontable plugin , wondering if there's way use "dependent" columns.

this is, when change 1 column, other updated depending on previous column value.

one of columns call location, , auto-complete shows list of possible locations. (city + postal code + country) that's correct, however, in database storing id each location. therefor need hidden column store (which i've created) need updated when user change location column using auto-complete.

is possible somehow? didn't find either in documentation or @ internet.

thanks.

yes, have done same reasons you

using afterchange event...

afterchange: function (changes, source) { afterchange(changes, source); } 

... can change values of other cells ...

function afterchange(changes, source) {     if (source === 'loaddata') {         return; //don't on load     }     var rowindex = 0, columnid = 1, oldtextval = 2, newtextval = 3, ntv = '', nv = '';     $(changes).each(function () {         if (this[columnid] === 'regionid') {             //make sure nothing else happens when these columns set through below, avoid circular references         }         else if (this[columnid] === 'regionname') {             ntv = this[newtextval];             //i have dropdown used filtering has id value id             nv = $('#regionsfilterdropdown option').filter(function () { return $(this).text() === ntv; }).val();             $container.handsontable('setdataatcell', this[rowindex], 12, nv);         }     }); } 

i hope helps...


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -