Hello,
I am using a combobox within an igGrid and implemented everything according to the following forum post:
http://ko.infragistics.com/community/forums/p/72892/370474.aspx
The only difference is that I am using oData and not local data.
I can fill the combobox and edit the values in the grid.
However, I am unable to fill the lookup array for the formatter function.
Here I setup my lookup data source: (TypeScript)
var mediasSchema = new Infragistics.DataSchema("json", { fields: [ { name: "ID", type: "number" }, { name: "Name", type: "string" } ], searchField: "value" }); this.medias = new Infragistics.RemoteDataSource({ autoCommit: true, responseDataKey: "value", responseDataType: "json", responseContentType: "application/json; charset=utf-8", dataSource: host + 'odata/Medias?$select=ID,Name', schema: mediasSchema, dataBound: () => this.fillMediaNameLookup(this._lookupMediaList) });
And then I call:
(<any>this.medias).dataBind();
By the way, the TypeScript declaration of dataBind is not correct in Infragistic's ".d.ts" file. That's why I have to do the casting.
I use the dataBound event to fill the lookup array.
Unfortunately, the data source is still empty when the dataBound event is raised.
I can see in the browser's debugging tools that the dataBound event is called even before the JSON is returned and processed.
Is this a bug?
If yes, I would need a fix asap. If not, can you modify the sample from the forum post that I mentioned above so that it works with oData. (Both, the table data and the lookup data comes from an oData source.)
Thanks!
Joern
Hello Joern,
We may need more information regarding the igGrid definition. If possible please attach a copy the igGrid definition code together with your reply. If you have any questions, please let us know.
Hello Vivian,
here is my grid definition:
{ dataSource: products, responseTotalRecCountKey: 'odata.count', primaryKey: 'ID', virtualization: false, virtualizationMode: 'fixed', autoCommit: true, columns: [ { headerText: 'Product ID', key: 'ID', dataType: 'number', width: '20%' }, { headerText: 'Product Name', key: 'Name', dataType: 'string', width: '50%' }, { headerText: 'Media', key: 'MediaRef', dataType: 'number', formatter: lookupMediaName, width: '30%' }], caption: 'Test', height: '300px', width: '80%', features: [ { name: 'LoadOnDemand', chunkSize: 5, type: 'remote', loadTrigger: 'button' }, { name: 'Sorting', applySortedColumnCss: false, featureChooserSortAsc: 'Sort A to Z' }, { name: 'Filtering', type: 'remote', mode: 'simple' }, { name: 'RowSelectors', enableCheckBoxes: true, enableRowNumbering: false }, { name: 'Selection', multipleSelection: true }, { name: 'Updating', enableAddRow: false, columnSettings: [{ //The combo is defined as an editor provider. Combo options are defined under 'editorOptions'. columnKey: 'MediaRef', editorType: 'combo', required: false, editorOptions: { mode: 'dropdown', dataSource: medias, responseDataKey: 'value', textKey: 'Name', valueKey: 'ID' } }] }] }
Best regards,