Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
gird data is not getting populated
posted

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>
}

Parents
  • 515
    Offline posted

    Its working when i m making autoGenerateColumn:true why is that?when its false i m specifying names it should work?

Reply Children