|
<script type="text/x-jsrender" id="columnTemplate">
<input type="text" class="dropdown" />
</script>
<ej:Grid ID="FlatGrid" runat="server" AllowSorting="True" AllowPaging="True" IsResponsive="true">
<ClientSideEvents templateRefresh="template" />
<Columns>
<ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="True" TextAlign="Right" Width="75" />
<ej:Column Field="CustomerID" HeaderText="Customer ID" Width="80" />
<ej:Column Field="EmployeeID" HeaderText="Employee ID" TextAlign="Right" Width="75" Priority="4" />
<ej:Column Field="Freight" HeaderText="Freight" TextAlign="Right" Width="75" Format="{0:C}" Priority="3" />
<ej:Column Field="ShipCity" HeaderText="Ship City" Width="110" Priority="2" />
<ej:Column HeaderText="Dropdown" Template="#columnTemplate" Width="150" />
</Columns>
</ej:Grid>
<script>
function template(args) {
var Customers = [
{ id: "1", text: "ALFKI" }, { id: "2", text: "ANATR" }, { id: "3", text: "ANTON" },
{ id: "4", text: "AROUT" }, { id: "5", text: "BERGS" }, { id: "6", text: "BLAUS" }
];
$(args.cell).find(".dropdown").ejDropDownList({
dataSource: ej.DataManager(Customers),
fields: { id: "id", text: "text", value: "text" },
selectedIndex:1
});
}
</script> |