Hi all,
I need to add comment column in the iggrid but the grid only shows less number of characters.So i decide to show the comment in the popup.
and edit the comment and i want to save the edited comment back to the cell from the popup.Kindly Please help me with this.
Hello Lakshmi,
Thank you for posting in our community.
Once the new comment is entered, the value of the textbox can be retrieved and set to the igGrid`s cell. This can be achieved by using the setCellValue method. This method sets a cell value for the specified cell. It also creates a transaction and updates the UI. setCellValue has three parameters :
For example:
//handle Save button click
$("#saveButton").click(function(){
//retrieve text box value textboxval = $("#commentTxt").val();
//set this value to the igGrid`s cell $("#your_grid_id").igGridUpdating("setCellValue", 5, "YourColumnKey", textboxval);
});
Please let me know if you need any further assistance with this matter.
Hi Vasya,
Thank you for your response.
I have tried your method but its not working for me.Kindly assist me to correct my code.
Below code is cell click event code to open the dialog box.its working fine but i used this code before features.this code is not working inside the features.Is there any event that works as similar to cellclick?
cellClick: function (evt, ui) { if(ui.colKey=="Comment") { rowId = ui.rowIndex; colKey=ui.colKey; cellValue =ui.cellElement.textContent; document.getElementById("inputComment").innerHTML =cellValue; $('#CommentSection').modal('show'); } }, features: [
//after the cell click
$("#Savebtn").click(function(){
//retrieve text box value textboxval = $("#inputComment").val(); //set this value to the igGrid`s cell $("#Grid").igGridUpdating("setCellValue", rowId, "Comment", textboxval); $('#CommentSection').modal('hide'); });
///the error i am getting after the run
4jquery-2.1.4.js:250 Uncaught Error: cannot call methods on igGridUpdating prior to initialization; attempted to call method 'setCellValue' at Function.error (jquery-2.1.4.js:250) at HTMLDivElement.<anonymous> (jquery-ui-1.11.4.js:502) at Function.each (jquery-2.1.4.js:374) at jQuery.fn.init.each (jquery-2.1.4.js:139) at jQuery.fn.init.$.fn.(anonymous function) [as igGridUpdating] (localhost:25461/.../jquery-ui-1.11.4.js:494:9) at HTMLButtonElement.<anonymous> (Index:250) at HTMLButtonElement.dispatch (jquery-2.1.4.js:4435) at HTMLButtonElement.elemData.handle (jquery-2.1.4.js:4121)
Kindly help me with this