Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #102925

    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.

    #102928
    admin
    Keymaster

    Hi,

    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 Stoev

    Smart UI Team
    https://www.htmlelements.com/

    #102929

    Hello:
    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.

    #102930
    admin
    Keymaster

    Hi

    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 Stoev

    Smart UI Team
    https://www.htmlelements.com/

    #113137
    Hitesh Chauhan
    Participant

    Thanks, Peter, for the detailed explanation — that really helps clarify how Smart UI handles routing and dependencies. I was facing a similar issue while integrating an tailwind dashboard templates with a CodeIgniter app, and your example made it clear that each page needs its JS dependencies configured directly in the routing file. It’s a bit manual but ensures cleaner separation and better control over scripts per page. I’ll try defining scriptUrls for each view in my setup instead of loading all JS globally. Appreciate the support and the great work your team continues to do with Smart UI!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.