Hello everyone,
So i was using a code provided in forum the grid id getting displayed but it is not getting populated with data.Could you help me out alittle.I wanted to make the grid and apply some validation like if previous field eg marks have marks less than 50 so we date is optional else required.Also i want to apply filter manullay for date is it possible and i want to display only month years if that is possible.
<html> <head>
</head>
<body> <table id="grid"></table> </body>
</html>
@section scripts{ <script> $(document).ready(function () { var testData = [ { "ID": 1, "Name": "Name 1", "ExpireDate": new Date() }, { "ID": 2, "Name": "Name 2", "ExpireDate": new Date() }, { "ID": 3, "Name": "Name 3", "ExpireDate": new Date() }, { "ID": 4, "Name": "Name 4", "ExpireDate": new Date() }, { "ID": 5, "Name": "Name 5", "ExpireDate": new Date() }, { "ID": 6, "Name": "Name 6", "ExpireDate": new Date() } ]; $("#grid").igGrid({ height: "100%", width:"100%", dataSource: testData, columns: [ { headerText: "ID", key: "ID", dataType: "number", width: "50%" }, { headerText: "Name", key: "Name", dataType: "string", width: "25%" }, { headerText: "Expire Date", key: "ExpireDate", dataType: "date", width: "25%" } ], autoGenerateColumns: false, primaryKey: "ID", features: [ { name: "Updating", editMode: "row", columnSettings: [ { columnKey: 'ExpireDate', required: false, editorType: 'datepicker' } ], editCellStarting: function (evt, ui) { // Do not let users edit even numbered rows. if (ui.columnKey == "ExpireDate" && ui.rowID % 2 == 0) return false; } } ] }); }); </script> }
Its working when i m making autoGenerateColumn:true why is that?when its false i m specifying names it should work?
Also why its only blocking the expirydatevalue and rest field it let me change when the if condition if satified?It shouldnt let you edit complete row?but its not working like that? And could you explain what does return false mean here?that if row editing starts and the if condition if satisfied it will not let you edit the row?
To replicate your behavior using de-populated data, I've been exploring your question and prepared a short sample. With igGrid, your code snippet works. The grid shows and data is bound and filled regardless of autoGenerateColumns. Perhaps another parameter or custom logic is causing the described behavior. geometry dash