EasyUI Forum
November 03, 2025, 08:21:28 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: panel('options').href behaviour  (Read 7422 times)
mzeddd
Full Member
***
Posts: 223



View Profile
« on: April 29, 2015, 05:35:59 AM »

Hi,

I use the following function to load content into my panel

Code:
function doSearch(){
$.post('Search.php',
$("#searchForm").serialize(),
function(data){
$("#results").panel({content:data});
}
);
}

It works very well.

But if I have the following line in reply from web server ('data') then I see that 'Search.php' is called twice. One via POST and one via GET.
Code:
<script>$("#results").panel('options').href='Search.php';</script>

I need "$("#results").panel('options').href='Search.php';" just to update 'href' and use it later. But in case if I return it in reply it works as if I call 'refresh'.

Why it is happening? Why refresh for the panel is called?


Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: April 29, 2015, 07:36:09 AM »

When you call this statement:

$("#results").panel({content:data});

The panel will be created. If the 'href' property value exists, the panel content will be loaded via 'href'. To prevent from loading content from remote server, please remove this 'href' value. If you want to update the content from remove server, please call 'refresh' method instead.

$('#results').panel('refresh', 'Search.php');

If you only want to update the content with a given 'data', please try the jQuery's native 'html' method:

$('#results').html(data);
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!