Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
bikedorkseattle Posted January 15, 2018 Posted January 15, 2018 I'm working on my first application that is using jQuery DataTables. I've figured out how to load the JS and CSS files by putting them in the execute method in the controller, however I'm a bit stumped on how to properly add the images that come bundled with DataTables and are called in the CSS. The apps CSS is here: forum/applications/core/interface/css/css.php?css=applications/tripreport/dev/css/front/datatables.css&v=18dfebd6d5 and it's looking for the images here which is throwing a 404: forum/applications/core/interface/css/DataTables-1.10.16/images/sort_both.png My question is if you are bundling images in an app how do you properly call these? I'm under the impression I need to change the DataTables CSS to call them in a similar manner as documented here?
Stuart Silvester Posted January 15, 2018 Posted January 15, 2018 You may want to take a look at our built in methods for tables. \IPS\Helpers\Table\Custom allows you to supply data that can be used for quick search, ordering, pagination etc. The benefit is that it'll do all of those items automatically (if you enable them).
bikedorkseattle Posted January 16, 2018 Author Posted January 16, 2018 @Stuart Silvester I appreciate the reply. I do think your table solution is pretty great, in this instance I need the features of DataTables because this data is not coming from IPB. Forget for a moment I'm doing this for tables, is my assumption correct that I'll need to add something like the following code in the CSS url argument to get this to work? url('{resource="example.jpg" app="yourapp" location="front"}')
DesignzShop Posted January 16, 2018 Posted January 16, 2018 2 hours ago, bikedorkseattle said: @Stuart Silvester I appreciate the reply. I do think your table solution is pretty great, in this instance I need the features of DataTables because this data is not coming from IPB. Forget for a moment I'm doing this for tables, is my assumption correct that I'll need to add something like the following code in the CSS url argument to get this to work? url('{resource="example.jpg" app="yourapp" location="front"}')
bfarber Posted January 16, 2018 Posted January 16, 2018 20 hours ago, bikedorkseattle said: I'm working on my first application that is using jQuery DataTables. I've figured out how to load the JS and CSS files by putting them in the execute method in the controller, however I'm a bit stumped on how to properly add the images that come bundled with DataTables and are called in the CSS. The apps CSS is here: forum/applications/core/interface/css/css.php?css=applications/tripreport/dev/css/front/datatables.css&v=18dfebd6d5 and it's looking for the images here which is throwing a 404: forum/applications/core/interface/css/DataTables-1.10.16/images/sort_both.png My question is if you are bundling images in an app how do you properly call these? I'm under the impression I need to change the DataTables CSS to call them in a similar manner as documented here? I can't see what's in datatables.css, but as a general guideline any third party code should indeed be located under the interface directory (but for your application, not the core application). You should be able to use the resource tag for this like: url('{resource="css/DataTables-1.10.16/images/sort_both.png" app="tripreport" location="interface"}')
Recommended Posts
Archived
This topic is now archived and is closed to further replies.