1

I created some tabs using jQuery EasyUI tabs. The content of the tab is loaded by Ajax because I pass the href attribute to my tab like:

<div id="mytabs" class="easyui-tabs" style="width:500px;height:250px;">  
    <div title="Tab1" href="/app/controller/tab_content" style="padding:20px;">  
        tab1  
    </div>  
    <div title="Tab2" href="/app/controller/tab_content" style="padding:20px;">  
        tab2  
    </div>  
    <div title="Tab3" href="/app/controller/tab_content" style="padding:20px;">  
        tab3  
    </div>  
</div>

As you can see above, every time a tab is selected, the action tab_content which contains the content to be displayed in the tab panel (/app/controller/tab_content is just for illustration) is called. All of this work fine, but what I'm trying to do is to make a variable available to the view tab_content.ctp when the url is called (WITHOUT passing it as a parameter in the url) like:

/app/controller/tab_content/my_variable:test

Is there any way that I can pass a variable to my view when the tab is clicked without passing it to the url of the tab content? In order words, I want my_variable to be available to the view tab_content.ctp when the tab is clicked.

Note: This is a cakephp application

Thank you

user765368
  • 19,590
  • 27
  • 96
  • 167

2 Answers2

0

You might have solved the problem already, but I ran into a similar issue with EasyUI tabs and remote content and thought I might share it. What I ended up doing was

  • for the variable to be passed: declare it as a window.variable, i.e. by setting window.my_variable = my_variable
  • for the external tab content: call the variable via javascript in the external file - since a window.variable has global scope, it is also available in dynamically loaded content (see this answer)

Hope this is of help.

Community
  • 1
  • 1
Bernd
  • 675
  • 3
  • 13
  • 23
0

Edit jquery.easyui.min.js and search for:

$.fn.panel.defaults

Change method: "get" to method "post"

Sal00m
  • 2,938
  • 3
  • 22
  • 33
Ardy Ant
  • 59
  • 1
  • 10