E
egarcia
Guest
Hello Martin, Based on your description, it looks like the DropDownList is working fine. Could you provide more information on your issue? Is the issue that the related value is not showing? (set up of template property is not working) Do you get any error messages? The sample code that Ricardo Perdigao mentioned above, corresponds to a grid for the Customer table. One its columns is used to show the RepName from the Salesrep table. The code only needs to refer to the data source for Salesrep because the data source for Customer is handled by the grid. Please notice that the code uses $scope._$ds.SalesrepDS.read() to read the data into the SalesrepDS. Otherwise, the data source would be empty. In your scenario, you mention about using two tables. Could you clarify on how do you use them? Here is a sample program showing how to add a Kendo UI DropDownList component to a grid using a custom view (created using the blank view option). Links: oemobiledemo.progress.com/.../grid-dropdownlist Source code for view-factory.js: oemobiledemo.progress.com/.../view-factory.js Here is the code for the onShow() handler: this.scope = $scope; $scope._$ds.SalesrepDS.read(); var that = this; $scope.grid0.options.columns[3].template = function(dataItem) { $scope._$ds.SalesrepDS.filter( {field: "SalesRep", operation: "eq", value: dataItem.SalesRep} ); var view = $scope._$ds.SalesrepDS.view(); if (view.length > 0) { return " " + kendo.htmlEncode(view[0].RepName) + " "; } else { return " (record not found) " } }; var dataSourceOptions = $scope._$ds.SalesrepDS.options; $scope.grid0.options.columns[3].editor = function(container, options) { var input = $(" "); input.attr("name", options.field); // Clear filter to ensure that all values are shown $scope._$ds.SalesrepDS.filter({}); input.appendTo(container); input.kendoDropDownList({ dataSource: dataSourceOptions, dataTextField: "RepName", dataValueField: "SalesRep", }) }; Please let me know if you need more information. I hope this helps.
Continue reading...
Continue reading...