EasyUI Forum
May 23, 2024, 05:05:13 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: Datagrid "onLoadSuccess" fires twice  (Read 7067 times)
siroccoicode
Newbie
*
Posts: 4


View Profile Email
« on: August 05, 2014, 08:58:26 PM »

I found  when datagrid was loaded,the onLoadSuccess event fired twice.
Code:
<script type="text/javascript">
$('#test').datagrid({
url:'datagrid_data1.json',
method:'get',
onLoadSuccess:function(data){
alert(1);
$('.datagrid-header td:contains(de)').click(function(){
alert(2);
});
}
});
</script>
When I refresh page, the output displays "1" twice.
why? In my mind, onLoadSuccess event should fire only once.
Logged
siroccoicode
Newbie
*
Posts: 4


View Profile Email
« Reply #1 on: August 05, 2014, 10:53:53 PM »

 Grin
I has solved it. Because I declared this datagrid in the  HTML<body> ,and I append  some new attributes  for datagrid in the javascript ,so this datagrid  is reloaded.
My solution is : throw them into $(function),then all are OK! Grin
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!