I am trying to figure out how to add DevExtreme’s grid to wordpress.
Here is an example of what I am trying to add to wordpress.
I have added the scripts in the functions.php file with wp_enqueue_script, so that this will load with all the pages.
Now I am trying to figure out how to add the data part
I am now trying to figure out where I can add the code, markup and data. Each of these pieces will be different on each load.
Does anyone have any suggestions on where I can put this?
Thank you so much!
<div id="gridContainer"></div>
$("#gridContainer").dxDataGrid({
dataSource: customers,
paging: {
pageSize: 10
},
pager: {
showPageSizeSelector: true,
allowedPageSizes: [5, 10, 20]
},
columns: ['CompanyName', 'City', 'State', 'Phone', 'Fax']
});
and
var customers = [{
"ID": 1,
"CompanyName": "Super Mart of the West",
"Address": "702 SW 8th Street",
"City": "Bentonville",
"State": "Arkansas",
"Zipcode": 72716,
"Phone": "(800) 555-2797",
"Fax": "(800) 555-2171",
"Website": ""
}, {
"ID": 2,
"CompanyName": "Electronics Depot",
"Address": "2455 Paces Ferry Road NW",
"City": "Atlanta",
"State": "Georgia",
"Zipcode": 30339,
"Phone": "(800) 595-3232",
"Fax": "(800) 595-3231",
"Website": ""
}]
Looks to me like you may need a custom post type or custom fields that allow you to enter and manage fields like: “CompanyName” “Address” “City” “State” “Zipcode” “Phone” “Fax” “Website”
See http://codex.wordpress.org/Post_Types
Unless those fields are associated with a post, I don’t know how you can manage them, grid or otherwise!