JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums General Discussions Integrate admin templates with codeigniter application

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #102925
    Up
    0
    Down

    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
    Up
    0
    Down

    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
    Up
    0
    Down

    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
    Up
    0
    Down

    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/

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