BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
http://js.syncfusion.com/demos/web/#!/azure/grid/rows/rowtemplate
<script id="templateData" type="text/x-jsrender"> <tr> <td class="photo"> <img src="../themes/images/Employees/{{:EmployeeID}}.png" alt="{{:EmployeeID}}" /> </td>
<td class="details"> {{:~getProductById(EmployeeID) }} </td> <td class="details"> <table class="CardTable" cellpadding="3" cellspacing="2"> <colgroup> <col width="50%"> <col width="50%"> </colgroup> <tbody> <tr> <td class="CardHeader">OrderID</td> <td>{{:OrderID}} </td> </tr> <tr> <td class="CardHeader">CustomerID</td> <td>{{:CustomerID}} </td> </tr>
</tbody> </table> </td> </tr> <script type="text/javascript">
$.views.helpers({ getProductById: function (productId) { var i, len, product, ref; ref = window.employeeView; for (i = 0, len = ref.length; i < len; i++) { product = ref[i]; if (product.EmployeeID === productId) { return product.FirstName; } } return ''; } }); |
<script type="text/javascript"> $(function () { $("#Grid").ejGrid({ // the datasource "window.gridData" is referred from jsondata.min.js dataSource: window.gridData, allowPaging: true, allowScrolling: true, columns: [ { field: "OrderID", isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, validationRules: { required: true, number: true }, width: 90 }, { field: "CustomerID", headerText: 'Customer ID', validationRules: { required: true, minlength: 3 }, width: 90 }, { field: "EmployeeID", headerText: 'Employee ID', editType: ej.Grid.EditingType.Dropdown, textAlign: ej.TextAlign.Right, width: 100, validationRules: { number: true, range: [0, 1000] } }, { field: "Freight", headerText: 'Freight', textAlign: ej.TextAlign.Right, editType: ej.Grid.EditingType.Numeric, editParams: { decimalPlaces: 2 }, validationRules: { range: [0, 1000] }, width: 80, format: "{0:C}" }, { field: "ShipName", headerText: 'Ship Name', width: 150 }, { field: "ShipPostalCode", headerText: 'Ship PostalCode', width: 150 }, { field: "ShipRegion", headerText: 'Ship Region', width: 150 }, { field: "ShipAddress", headerText: 'Ship Address', width: 150 }, { field: "ShipCountry", headerText: 'Ship Country', editType: ej.Grid.EditingType.Dropdown, width: 140 } ] });
});
|