BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
<ej:Column Field="FactoryID" HeaderText="Factory" TextAlign="Center" Visible="true" AllowEditing="true" Template="<span class='label' style='min-width:70px;font-size:12px;cursor:pointer;color:white;background-color:{{:FactoryColor}} !important'>{{:FactoryName}}</span>" EditType="Dropdown" ForeignKeyField="FactoryID" ForeignKeyValue="FactoryName" />
<ej:Grid ID="FlatGrid" runat='server' AllowPaging="true">
...
<Columns>
...
<ej:Column Field="EmployeeID" HeaderText="Employee ID" TextAlign="Center" Visible="true" AllowEditing="true"
Template="<span class='label' style='min-width:70px;font-size:12px;cursor:pointer;color:white;'></span>"
EditType="Dropdown" ForeignKeyField="EmployeeID" ForeignKeyValue="FirstName" />
...
</Columns>
<ClientSideEvents TemplateRefresh="refresh"/>
</ej:Grid>
<script>
function refresh(args) {
var data = ej.DataManager(this.model.columns[2].dataSource).executeLocal(ej.Query().where("EmployeeID", "equal", parseInt(args.rowData.EmployeeID), true)); //data for the corresponding column will be filtered using where query from DataManager
$(args.cell).find("span").css("background-color", data[0].Color);
//set the background color for the template column
$(args.cell).find("span").text(data[0].FirstName); //set the value for the template
}
</script> |