EasyUI Forum
May 21, 2024, 01:06:09 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: null urls preventing load [Solved]  (Read 7125 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: May 25, 2014, 09:42:22 PM »

I don't want to specify the url for a (tree, form etc) element at load time but instead I want to set it during run time.

The problem is, if I don't define the url at load time, or if I define it as empty string or null, then the load method will not work:

Code:
    $('#xx').combobox({
      onSelect:function(rec){
        var url = '/vwltsa/?_func=xxx;
        $('#yy').datagrid('load',url);
      }  
    });
    
    $('#emplt').datagrid({
      url:null,
      onLoadSuccess: function(){
        cl('loaded');
      }
« Last Edit: May 27, 2014, 06:26:22 AM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 26, 2014, 03:17:33 AM »

You must set the 'url' property before calling 'load' method.
Code:
$('#yy').datagrid('options').url = ...;
$('#yy').datagrid('load');
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: May 26, 2014, 03:20:37 AM »

Hi, thanks but the URL is already included in the load:

Code:
       var url = '/vwltsa/?_func=xxx';
        $('#yy').datagrid('load',url);

Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: May 26, 2014, 03:31:24 AM »

The 'load' method only accepts the query parameters. Just like this:
Code:
$('#dg').datagrid('load',{
code: '01',
name: 'name01'
});
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #4 on: May 26, 2014, 04:05:19 AM »

Would it be possible to also allow the url to be passed  same as for a form:

Code:
$('#ff').form('load','get_data.php');	// load from URL
Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: May 26, 2014, 08:51:10 AM »

Please download the patch file from http://www.jeasyui.com/download/downloads/jquery-easyui-1.3.6-patch.zip to solve your issue.
« Last Edit: May 26, 2014, 08:56:48 AM by stworthy » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!