I looked at implementing a datatable using webix on a laravel site. I used the following to reach the controller that returns a json object with the data inside, but webix isn’t loading this into the datatable.
Can someone help me troubleshoot why this is the case?
dtable.load("{{ url(’/getContacts’) }}", “json”);
full json object shows up in browser’s inspector console.
Data looks perfectly fine. It works for loading from static object
http://webix.com/snippet/4be2627d
Please double-check that output doesn’t contain anything except the above JSON. Also, which content-type has the output?
Here’s the example data I’m currently working with, and how it turns up in the browser:
[{"id":1,"firstName":"Bob","middleName":"","lastName":"Gerome","dateOfBirth":"1950-01-1","Gender":"M"
,"Height":"68","Weight":"185","Pounds":1,"Kilograms":0,"ClientStatus":"Employee","Street":"2648 River Run","City":"Boston","State":"Florida","Zipcode":"19546","PhoneNumber":"4045556689","Email":"BOB@kudseo.com","ProspectOrClient":"Client","InsuranceType":"Yes","HealthInsurance":0,"Duration":"12"
,"CarInsurance":0,"FixedLife":0,"LifeInsurance":0,"RetirementPlan":0,"MortgageFinancing":0,"InsurancePlanning"
:0,"IncomeProtection":0,"FinancialPlanning":0,"Active":0,"lastContacted":"2016-04-15","Notes":"None"
,"created_at":"2016-04-15 11:28:20","updated_at":"2016-04-15 11:28:28"}]
Can you post the example of JSON object ?
It must be an array of data objects. If JSON response has a different structure, it possible to use pre-processing logic on a client side to convert incoming JSON data to the required format.