Results 1 to 3 of 3

Thread: How to dinamically require components to my project?

  1. #1
    Sencha User Carlos Souza's Avatar
    Join Date
    May 2015
    Location
    Minas Gerais, Brazil.
    Posts
    29
    Answers
    1

    Default Answered: How to dinamically require components to my project?

    Hello guys.

    I am new to ExtJS 5, but I already worked with ExtJS 3.
    I have a question: is it possible to dynamically add components to my project?

    For example, my system has two types of users: common user and administrator user.
    The admin user must have access to the views X, Y and Z, but the common user must only have access to the views X and Y.
    I want to require the views X, Y and Z when the administrator log into the system and require just the views X and Y when the common user log into the system.

    Can I require these views dynamically in ExtJS 5? I must do it in Application.js, right?

    Thanks in advance and sorry for my english...

  2. Assuming that you have checks in place to make sure a view isn't being accessed if they don't have permissions, you can use Ext.require() to require the views conditionally. This will include the classes and all direct dependencies.

  3. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    Assuming that you have checks in place to make sure a view isn't being accessed if they don't have permissions, you can use Ext.require() to require the views conditionally. This will include the classes and all direct dependencies.
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  4. #3
    Sencha User Carlos Souza's Avatar
    Join Date
    May 2015
    Location
    Minas Gerais, Brazil.
    Posts
    29
    Answers
    1

    Default

    Quote Originally Posted by tristan.lee View Post
    Assuming that you have checks in place to make sure a view isn't being accessed if they don't have permissions, you can use Ext.require() to require the views conditionally. This will include the classes and all direct dependencies.
    Great!

    I will try this! Thank you!

Similar Threads

  1. I want to use the components available in sencha market in my project in Sen Architec
    By Saruchi in forum Sencha Architect 2.x: Help & Discussions
    Replies: 1
    Last Post: 11 Nov 2013, 1:58 AM
  2. Replies: 3
    Last Post: 2 Jul 2012, 4:09 AM
  3. Replies: 4
    Last Post: 1 Jun 2011, 2:01 PM
  4. nested tabPanels, dinamically added tabPanel don't show its components
    By mattia in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 7 Mar 2008, 6:20 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •