@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper "*, Syncfusion.EJ"
@addTagHelper *, Syncfusion.EJ2 |
<div>
EJ1 Rating
</div>
<div>
<ej-rating id="test" value="5" />
</div>
<br/>
<div>
EJ2-Grid
<ejs-grid id="Grid" dataSource="@ViewBag.gridData" allowPaging="true" queryCellInfo=" template">
<e-grid-columns>
<e-grid-column headerText=" Employee Rating " width="200" template="#columnTemplate"></e-grid-column>
<e-grid-column field="OrderID" headerText="Order ID" textAlign="Right" width="120"></e-grid-column>
<e-grid-column field="CustomerID" headerText="Customer Name" width="150"></e-grid-column>
<e-grid-column field="OrderDate" headerText=" Order Date" textAlign="Right" format="yMd" width="130"></e-grid-column>
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" width="120"></e-grid-column>
<e-grid-column field="ShippedDate" headerText="Shipped Date" textAlign="Right" format="yMd" width="140"></e-grid-column>
<e-grid-column field="ShipCountry" headerText="Ship Country" width="150"></e-grid-column>
</e-grid-columns>
</ejs-grid>
</div>
<script type="text/x-jsrender" id="columnTemplate">
<input type="text" class="rating" />
</script>
<script type="text/javascript">
function template a(args) {
if (args.data.EmployeeID < 5) {
$(args.cell).find(".rating").ejRating({ allowReset: false, value:"4" });
}
else $(args.cell).find(".rating").ejRating({ allowReset: false, value: "3" });
}
</script> |
|