JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › General Discussions › Integrate admin templates with codeigniter application
Tagged: page templates
- This topic has 3 replies, 2 voices, and was last updated 2 years, 7 months ago by admin.
-
AuthorPosts
-
March 2, 2022 at 2:24 pm #102925chustisforol@hotmail.comParticipant
Hello: I am developing a web application and would like to use one of your dashboard templates. I am making the application in codeigniter, and I would like to know how to link your “admin-template” to be able to load the pages of my application from that template.
March 3, 2022 at 7:36 am #102928adminKeymasterHi,
In the folder of an admin template, there is a file called ‘routing.js’ and a setupRouting function inside it. There you can define the routes to the different page. To learn how to define a page, you can look at some of the folders in the admin template like: “detail”. It has 4 files inside it – index.htm, template.htm, styles.css and index.js. The index.js defines scripts after the page is loaded, styles.css defines page-specific styles, index.htm defines the page’s title, template.htm defines the page’s content.
Best regards,
Peter StoevSmart UI Team
https://www.htmlelements.com/March 3, 2022 at 5:34 pm #102929chustisforol@hotmail.comParticipantHello:
The big problem I run into is that I need a large number of .js files. Most of these files are contained in the “jqwidgets” folder, because they are necessary to use jqxgrid, jqxnumberinput, jqxfileupload,…
For this I use a file (metabase.php) where I include all those libraries, as follows:<script type=”text/javascript” src=”<?php echo base_url() ?>js/jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”<?php echo base_url() ?>js/jqwidgets/jqxdata.js”></script>
<script type=”text/javascript” src=”<?php echo base_url() ?>js/jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”<?php echo base_url() ?>js/jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”<?php echo base_url() ?>js/jqwidgets/jqxgrid.js”></script>
<script type=”text/javascript” src=”<?php echo base_url() ?>js/jqwidgets/jqxgrid.selection.js”></script>
<script type=”text/javascript” src=”<?php echo base_url() ?>js/jqwidgets/jqxgrid.columnsresize.js”></script>
<script type=”text/javascript” src=”<?php echo base_url() ?>js/jqwidgets/jqxgrid.edit.js”></script>And many more files.
I load this file from the view, as follows:
<?php
$this->load->view(‘metabase’);
?>
They seem to load correctly, but for some reason the .js file that I call from routing.js (which needs all those files) gives me an error. Everything indicates that it is not loading the .js that it needs.Do I have to pass all these .js to it from routing.js itself? Isn’t there a more comfortable way to do it?
Thank you very much.
March 4, 2022 at 8:19 am #102930adminKeymasterHi
The JS files should be configured in the routing as well. Each page has different dependencies and the configuration should be set there.
Example:
{ path: '/dashboard-2', template: './dashboard-2/template.htm', styleUrls: ['./dashboard-2/styles.css'], scriptUrls: [ '../../../smart/source/modules/smart.calendar.js', './dashboard-2/index.js' ], title: 'Dashboard 2 - ' + defaultTitle }
Best regards,
Peter StoevSmart UI Team
https://www.htmlelements.com/ -
AuthorPosts
- You must be logged in to reply to this topic.