Hi Team,
I am trying to add/update a row to grid using a dialog. I bind a set of complex objects to the grid and for adding/editing a new row, I open a dialog.
For binding, I use:
column.For(x => x.Status).DataType("object").HeaderText("Status").FormatterFunction("function(val){return val.Name;}");
This way when initially grid binds, the complex object displays properly.
When I open a edit pop up, it does not display the same value in the dropdown (populated using Viewbag). How to fix this? Also, when I select a value and try to rebind the grid after closing a dialog the complex object values do no rebind. How to display the selected value in the grid?
Another issue is of date picker control. In the same dialog I have date, I want to display in yyyy-MM-dd format. I use a datepicker control, the calendar opens in the back of the input text box. Tried to increase the z-index using the below code, but didn't work.
.ui-datepicker { z-index: 1100 !important; }
Also, it is not displaying the selected date back in the grid.
Expecting a fast reply on this.
Thank you.
-Regards,
Agraj
Hello Agraj,
I am still following your case. Have you been able to resolve the issue?If you have any concerns or questions, please feel free to contact me, I will be glad to help you.Thank you for choosing Infragistics components!
Best regards,
Stamen Stoychev
Hi Agraj,
As Denis noted, binding to complex objects and the grid functionality related to columns of object type is currently not supported out of the box. You will need custom implementation for Updating to work properly, as well as, any other feature you wish to enable for that column.
With this said what you are trying to achieve isn't impossible. Updating communicates with its editors through wrapper classes called editor providers. This topic, while focused on another use case will give you a better idea of how to use them. This sample uses a custom provider to implement an igUpload control as an editor for the grid.
I've prepared a simple sample that shows how to extend the existing ComboProvider to work with your complex object. However, this solution is not supported by the MVC wrappers which you appear to be using as they don't allow for custom providers to be set for columns. Instead, if you want to use the MVC wrappers for igGrid you'll need to overwrite the default provider for igCombo and apply your logic for all combo widgets used by the grid.
I am attaching the sample using the cleaner JavaScript-only version of the solution whereas for the MVC wrappers solution you'll have to add the following to the rendered event handler of igGrid:
$.ig.EditorProviderCombo.prototype.getValue = function () { var items = this.editor.selectedItems(); if (items) { return this.editor.selectedItems()[0].data; } }; $.ig.EditorProviderCombo.prototype.setValue = function (val, fire) { var value = val.ID; this.editor.value(value, null, fire); };
Hope this helps! Please, let me know if you have any other questions or concerns!
Hi Denis,
Binding the editor dialog with dropdown control back to the grid is a common feature which I believe must be used whenever one binds a complex object to grid and open a dialog to add/edit an object. Even this is not supported? That's strange.
If it is not clear, what I want is:
1) I bind complex object to grid (using: .FormatterFunction("function(val) {if(val){return val.Name;} else {return '';}}")
2) Open dialog to edit.
3) That dialog has Status dropdown (Order.Status -> Status has Id and Name as text key and value key respectively)
4) I select a different status and click Done and close the pop-up.
5) Instead of showing the text (Name) of status back in the Grid column, it shows undefined.
If this is not supported, any alternate way to achieve this functionality?
Thank you for your patience
After looking into how to bind editor dialog to complex property and doing some research, it has been determined to be a new product idea. I would recommend you to log it at http://ideas.infragistics.com, the Product Ideas site allows you to suggest new product features, new functionalities in existing products and controls, and even request new controls and products altogether. Members of the Infragistics Community then vote for the features and suggestions they want to see added to the products, resulting in the most popular features bubbling up to the top. When planning new releases, our Product Management team will look at the most popular features and use your feedback to prioritize upcoming work.
I was not able to reproduce the behaviour from the second issue that you're seeing on your side. I have attached the sample project I used to test this. Please test this project on your side; whether or not it works correctly may help indicate the nature of this issue. If this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.Please let me know if I can provide any further assistance.
Hi Zdravko,
Could you please provide an update on the issue? It has been a long time.