jQWidgets Forums
Forum Replies Created
-
Author
-
February 20, 2019 at 10:35 pm in reply to: Grid not being displayed MVC Core 2.2 Grid not being displayed MVC Core 2.2 #104092
So I changed the datatype of the property InvoiceAmt from decimal with a annotation of currency to float. After I did that and updated my database I no longer get the “Uncaught Syntax Error…”.
However, now when I run the application I am getting this error message in the console;
“Cannot read property ‘dataAdapter’ of undefined TypeError: Cannot read property ‘dataAdapter’ of undefined at HTMLDocument.<anonymous>”
I can get an empty grid control to display in my viewer if I add this;
<jqx-grid >
</jqx-grid>
However, as soon as I add the “source=”Model” to the tag I get the above error message. Right now my model only contains 4 properties and all the data for the records are being displayed with their values in the “…localData: [{ ‘Id’: 1, ‘InvoiceNumber’: 1001,….”.
Thanks, Ed
February 19, 2019 at 5:32 pm in reply to: Grid not being displayed MVC Core 2.2 Grid not being displayed MVC Core 2.2 #104071Hello Hristo,
Sorry, the first error was my fault. After I my previous post I realized the problem was I mistyped the name of the jqxgrid.storage.js file in my <script src=…> tag.Still am having a problem with the second message “Uncaught SyntaxError: Unexpected token , Invoices:77”. When I click on the “Invoices: 77” link in the console and look at the localData in the “<script type=’text/javascript’>$(function ()…” line the values for InvoiceAmt are null and look like this “‘InvoiceAmt’: ,” . In the Model the data type for that property is Currency. Do you think that is the problem?
Thanks for your help, Ed
February 19, 2019 at 4:40 pm in reply to: Grid not being displayed MVC Core 2.2 Grid not being displayed MVC Core 2.2 #104070Hello Hristo,
There was no “jqxrid.storage.js file included in the trial download. In my wwwroot/jqwidgets folder I do have the jqxgrid.storage.js file.
My code is not referring to the jqxrid.storage.js file. Isn’t the error message being generated because your js libraries are referring to that file?
Ed
February 18, 2019 at 9:33 pm in reply to: Grid not being displayed MVC Core 2.2 Grid not being displayed MVC Core 2.2 #104043Hi Hristo,
Yes there are error 2 messages in the console. Here they are;Failed to load resource: the server responded with a status of 404 () jqxrid.storage.js:1
Uncaught SyntaxError: Unexpected token , Invoices:77Yes, I know I have data in the model. I also have the following code in my Index.cshtml and the page displays the table. And as you can see I am using the same datafield names.
<table class=”table”>
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.InvoiceNumber)
</th>
<th>
@Html.DisplayNameFor(model => model.Customer)
</th>
<th>
@Html.DisplayNameFor(model => model.InvoiceAmt)
</th>
<th>
@Html.DisplayNameFor(model => model.InvoiceDate)
</th>
<th>
@Html.DisplayNameFor(model => model.DueDate)
</th><th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.InvoiceNumber)
</td>
<td>
@Html.DisplayFor(modelItem => item.Customer.CustomerName)
</td>
<td>
@Html.DisplayFor(modelItem => item.InvoiceAmt)
</td>
<td>
@Html.DisplayFor(modelItem => item.InvoiceDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.DueDate)
</td></tr>
}
</tbody>
</table> -
AuthorPosts