BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();
col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add();
col.Field("EmployeeID").HeaderText("Rating").EditTemplate(a => { a.Create("create").Read("read").Write("write"); }).TextAlign(TextAlign.Right).Width(175).Add();
col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(175).Format("{0:C}").Add();
col.Field("ShipCity").HeaderText("Ship City").Width(110).Add();
}))
<script type="text/javascript">
function create() {
return $("<input>"); // Create the input element
}
function write(args) {
var gridId = args.element.parents(".e-grid").attr("id");
args.element.ejRating({ value: args.rowdata !== undefined ? args.rowdata["EmployeeID"] : "", modelType: "picker" }); // Render the rating control
$("#" + gridId + "Color_Presets").css("display", "none");
}
function read(args) {
var a = $("#FlatGridEmployeeID").ejRating("instance");
return a.getValue(); // Read the rating value
}
</script> |