In a pre-sale ticket I was told there's a wpDT JS var (object) wpDataTables. Yes, I can see that. However, I'm not sure which "child property" has the comparable ojoect that DataTables.net has. For example, if I do
console.log(wpDataTables)
but if I try
console.log(wpDataTables.table_1)
I get and error.
Which I don't understand because I can see the property table_1 on the wpDataTables object. What am I missing? What am I thinking wrongly? :(
--
Ultimately**, I have a column in the table called (e.g.) place_id. I have a series of buttons above the table that represent the various place_id values. If I click the button for place_id = 1 then I want to filter / search the datatable and display only the rows where place_id = 1.
Just the same, I want to use other filters. For example, maybe I use a column search for the name column. I search for Tony . I then want the place_id buttons to reflect the place_id's for any of the Tony's. That is, once dt.js does it's filter / search magic I need to listen, get the unique place_id of the rows that matched the filter / search and then use those place_ids to rework my buttons.
To be clear, I'm not asking for help with the JS. I can do that, thank you :) I'm only wanting you to understand what I'm trying to do so you can point me to the details about wpDT that I need to get my job done. But without those details I'm lost and kinda shooting in the dark.
Thanks in advance!! :)
mfs
** Note: Above is an over-simplified example. I'm actually using Google Maps and markers on a map.
I built a (pre-WordPress) prototype with Google Maps and DataTable.js so I know what I'm looking to do __is__ possible. I've done it :)
Where I'm getting lost is trying to work with wpTD and not finding details and/or examples. This is not a complaint. Very nice product you have :) But if there was a page or two titled "If you've worked with DataTables.js here's how to approach wpTD" then I'd be a happy camper :) That's the gap I need to fill.
That said, I also realize I'm probably not a typical wpDT buyer / user. This I understand, of course. None the less, I wish the docs were more robust / detailed. These forums are great but having to wait for a reply slows me down :)
Both of these are in my own .js file. The WP enqueu deps for the .js is is set to '[wdt-wpdatatables']. That is, I presume I want my js to load __after__ wpDT's main .js. Is that correct?
Here's a copy of the wpDataTables object from console. Obviously, that's not showing you all the properties, but there is table_1 that is an object. So I'm not sure why I'm getting undefined.
p.s. I want to add, the table __is__ displaying on the front end. I can search / filter, etc. So it's there and working. What I can not do is get to the table_* object so I can interact with it and Google Maps.
It turns out that if I search / filter the table the addOnDrawCallback() will fire, but it does not - why? - fire on page load. Once that callback fires I can see the table_1 object. Finally.
However, as mentioned in my original ticket this object looks quite a bit different than the object created by native datatable.net.
We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.
Bogdan is on vacation so I will help you out.
Wpdatatables object is adjusted for wordpress environment but still is the same because is based on datatables plugin functionality.
Like is explained in our documentation: The front-end (JS) part of wpDataTables plays a significant role in the plugin’s functionality. Generally, front-end rendering is done by the DataTables jQuery plugin, but wpDataTables introduces some callbacks of its own.
All wpDataTables existing on the page are reflected in the global JavaScript object called ‘wpDataTables‘. If you check this variable in the JS developer console you will see the wpDataTables as properties of this object.
Hello again wpDT'ers :)
In a pre-sale ticket I was told there's a wpDT JS var (object) wpDataTables. Yes, I can see that. However, I'm not sure which "child property" has the comparable ojoect that DataTables.net has. For example, if I do
console.log(wpDataTables)
but if I try
console.log(wpDataTables.table_1)
I get and error.
Which I don't understand because I can see the property table_1 on the wpDataTables object. What am I missing? What am I thinking wrongly? :(
--
Ultimately**, I have a column in the table called (e.g.) place_id. I have a series of buttons above the table that represent the various place_id values. If I click the button for place_id = 1 then I want to filter / search the datatable and display only the rows where place_id = 1.
Just the same, I want to use other filters. For example, maybe I use a column search for the name column. I search for Tony . I then want the place_id buttons to reflect the place_id's for any of the Tony's. That is, once dt.js does it's filter / search magic I need to listen, get the unique place_id of the rows that matched the filter / search and then use those place_ids to rework my buttons.
To be clear, I'm not asking for help with the JS. I can do that, thank you :) I'm only wanting you to understand what I'm trying to do so you can point me to the details about wpDT that I need to get my job done. But without those details I'm lost and kinda shooting in the dark.
Thanks in advance!! :)
mfs
** Note: Above is an over-simplified example. I'm actually using Google Maps and markers on a map.
I built a (pre-WordPress) prototype with Google Maps and DataTable.js so I know what I'm looking to do __is__ possible. I've done it :)
Where I'm getting lost is trying to work with wpTD and not finding details and/or examples. This is not a complaint. Very nice product you have :) But if there was a page or two titled "If you've worked with DataTables.js here's how to approach wpTD" then I'd be a happy camper :) That's the gap I need to fill.
That said, I also realize I'm probably not a typical wpDT buyer / user. This I understand, of course. None the less, I wish the docs were more robust / detailed. These forums are great but having to wait for a reply slows me down :)
Again, thanks in advance.
Hi mark fs,
Thank you for your purchase.
Can you please tell me which error do you have in the console?
Also is there any link of that page so I can take a look and give you my suggestion.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Bogdan -
I'm getting: undefined.
Also, the addOnDrawCallback isn't firing.
Both of these are in my own .js file. The WP enqueu deps for the .js is is set to '[wdt-wpdatatables']. That is, I presume I want my js to load __after__ wpDT's main .js. Is that correct?
Here's a copy of the wpDataTables object from console. Obviously, that's not showing you all the properties, but there is table_1 that is an object. So I'm not sure why I'm getting undefined.
{
"table_1": {
"0": {},
"length": 1,
"context": {
"location": {
"href": "http://atmos-sb.dev/sample-page/",
"origin": "http://atmos-sb.dev",
"protocol": "http:",
"host": "atmos-sb.dev",
"hostname": "atmos-sb.dev",
"port": "",
"pathname": "/sample-page/",
"search": "",
"hash": ""
}
},
"selector": "#table_1",
"internal": {},
"oApi": {}
}
}
p.s. I want to add, the table __is__ displaying on the front end. I can search / filter, etc. So it's there and working. What I can not do is get to the table_* object so I can interact with it and Google Maps.
One more thing...
It turns out that if I search / filter the table the addOnDrawCallback() will fire, but it does not - why? - fire on page load. Once that callback fires I can see the table_1 object. Finally.
However, as mentioned in my original ticket this object looks quite a bit different than the object created by native datatable.net.
Hi mark,
Sorry for late response.
We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.
Bogdan is on vacation so I will help you out.
Wpdatatables object is adjusted for wordpress environment but still is the same because is based on datatables plugin functionality.
Like is explained in our documentation: The front-end (JS) part of wpDataTables plays a significant role in the plugin’s functionality. Generally, front-end rendering is done by the DataTables jQuery plugin, but wpDataTables introduces some callbacks of its own.
All wpDataTables existing on the page are reflected in the global JavaScript object called ‘wpDataTables‘. If you check this variable in the JS developer console you will see the wpDataTables as properties of this object.
Best regards.
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables