EasyUI Forum
May 11, 2024, 08:50:58 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: Using easyui offline  (Read 3210 times)
rezzonico
Full Member
***
Posts: 183


View Profile
« on: February 08, 2019, 02:29:30 AM »

Hi all,

I am writing a small application that must run offline.

Therefore I have added the following directive:
<html manifest="index.appcache">

The following example works:
https://www.ofima.ch/PPP.6/index1.html

But if the tab content is loaded with "href", when you select "tab2" a loading message appears and the tab content is not updated.
See the following example:
https://www.ofima.ch/PPP.6/index2.html


I am not sure but the reason could be that the "href" dynamically adds some code like "?_=1549621105203".


Thanks for any help.
Miche

« Last Edit: February 08, 2019, 04:23:16 AM by rezzonico » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 10, 2019, 07:52:28 AM »

This line '?_=1549621105203' is appended by jQuery when calling $.ajax with 'cache' set to false. To remove this line, please custom the 'loader' function for each tab panel.
Code:
<script type="text/javascript">
function myloader(param, success, error){
var opts = $(this).panel('options');
if (!opts.href){return false}
$.ajax({
type: opts.method,
url: opts.href,
cache: true,
data: param,
dataType: 'html',
success: function(data){
success(data);
},
error: function(){
error.apply(this, arguments);
}
});
}

</script>
<div id="tt" class="easyui-tabs" style="width:500px;height:250px;">
<div title="Tab1" href="tab1.html" data-options="loader:myloader">
</div>
<div title="Tab2"  href="tab2.html" data-options="loader:myloader">
</div>
</div>
Logged
rezzonico
Full Member
***
Posts: 183


View Profile
« Reply #2 on: February 12, 2019, 09:57:14 AM »

Thanks a lot !

Miche
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!