Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
555
Accessing grid row cells in hierarchical grid
posted

Hi,

I am using Hierarchical grid using load on demand. My grid contains few read only columns and few editable. Editable columns have a checkbox, dropdown and a free text box.

I am able to implement all the above editable controls. On save button click I want to show a message box to the user to confirm before proceeding. If a checkbox has been clicked in one of the rows in the grid I want to check if the dropdown or freetext has been entered or not in the same row. If the checkbox is clicked but none of the values have been entered in the drop down or the textbox I want to ask the user if he still want to continue ? I have written the following javascript to show the message:

$("#saveChanges1").on('igbuttonclick',

function (e) {

var trans = grid.igGrid("transactionsAsString");

if (trans === '[]') {

vex.dialog.alert({

className: 'vex-theme-os',

unsafeMessage: "<b>There are no changes to save.</b>"

});

} else {

vex.dialog.confirm({

className: 'vex-theme-os',

message: "A comment is expected – are you sure you want to save without entering a comment?",

buttons: [

$.extend({}, vex.dialog.buttons.YES, { text: 'Confirm' }),

$.extend({}, vex.dialog.buttons.NO, { text: 'Cancel' })

],

callback: function (data) {

if (data) {

//submit form

grid.igGrid("saveChanges", function (data2) {

if (data2.Success === true) {

vex.dialog.alert({

className: 'vex-theme-os',

unsafeMessage: "<b>Changes have been saved successfully</b>"

});

grid.igGrid("dataBind");

}

}, function () {

vex.dialog.alert({

className: 'vex-theme-os',

unsafeMessage: "<b style='color:red'>There was an error in saving the changes. Please contact the system administrator! </b>"

});

});

}

}

});

}

});

The above code works using grid.igGrid("transactionsAsString"); and it tells me if something has changed, but I am not sure how to access a particular row and its cells to check which cell have been changed and what is the value in it?

Can someone please help me with this and tell me how to access the grid cells values in javascript on save button click?

Regards

Singh

Parents Reply Children