above image is how the data is and we have enabled cell editing. Now when we double click [object Object] is being displayed, how can we bind it with previous data and then update rather showing [object Object]
Hello Satish,
Thank you for posting in our community.
Since I am not able to reproduce the described behavior on my side I will need to see a sample that demonstrates it. Please feel free to provide your own sample.
Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior.
Thank you for your cooperation.
Looking forward to hearing from you.
Regards,Viktor KombovEntry Level Software DeveloperInfragistics, Inc.
Hello Viktor,
Can we have a call rather as there is no sample.. please let me know if we can connect and discuss over the call.
thanks,
Satish
At this point, I believe that a remote session is not going to be the most efficient approach for resolving the issue because we will still need a sample reproducing the behavior, which we can debug on our side. Having this in mind, what I can suggest is using one of our samples and start adding your features and functionalities step by step in order to reproduce the behavior. This is going to be very helpful and will let us find the root cause of the behavior faster.
In the sample you shared, datatype is either string, numeric or date. I our case it is Object.
Can you try to reproduce with Object as datatype.
Thanks,
If the value that you are trying to edit is object, you should use an editor that can handle complex object. I believe you will find the Data Grid - Handling Complex Objects sample very helpful. There is demonstrated how you can use the igCombo control as an editor for columns with dataType "object":
// dataSource for the combo editor var northWindCategoriesJSON = [ { "ID": 0, "Name": "Food" }, { "ID": 1, "Name": "Beverages" }, { "ID": 2, "Name": "Electronics" } ]; $("#grid").igGrid({ ... columns: [ ... { headerText: "Category", key: "Category", dataType: "object", mapper: function (record) { return record.Category.Name; } } ], features: [ ... { name: "Updating", editMode: "cell", columnSettings: [ { columnKey: "Category", editorType: "combo", editorOptions: { dataSource: northWindCategoriesJSON, textKey: "Name", valueKey: "ID", mode: "dropdown" } } ] } ] });
Additionally, here you can find more detailed information regarding how to handle complex data extraction from complex objects.
Please let me know if you need any further assistance regarding this matter.
Thank you for your patience while I was looking into this matter for you.
I have created a small sample demonstrating how your requirement could be achieved by using the Custom Editor Provider feature of igGrid and handling the editCellEnding event of the igGridUpdating feature:
{ name: "Updating", ... columnSettings: [ { columnKey: "Category", editorProvider: new $.ig.EditorProviderInput() } ] } $.ig.EditorProviderInput = $.ig.EditorProviderInput || $.ig.EditorProvider.extend({ ... setValue: function (val) { if (val !== null && typeof val !== 'string') { this.editor.element.val(val.Name); } else { this.editor.element.val(val); } } ... });
{ name: "Updating", ... editCellEnding: function (evt, ui) { var record = $("#grid").igGrid("findRecordByKey", ui.rowID); if (ui.columnKey === 'Category') { if (!ui.rowAdding) { ui.value = { ID: record.Category.ID, Name: ui.value } } else { ui.value = { ID: Date.now() + Math.random(), Name: ui.value } } } } ... }
More information regarding the Custom Editor Provider feature you can find here.
Please test the sample on your side and let me know whether you find it helpful.
Thank you for getting back to me.
I am currently looking into this matter for you. I will keep you posted on my progress and I will get back to you as soon as possible with more information or questions for you.
Please feel free to continue sending updates to this case at any time.
Thank you for you feedback earlier but what we are looking for is how can we handle with text editor rather using igcombo because our requirement is something like updating description which cannot be a combo it has to text..