EasyUI Forum
May 08, 2024, 08:40:55 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: detailView - updating an expanded row makes the detail disappear  (Read 9060 times)
eliraz
Newbie
*
Posts: 12


View Profile Email
« on: August 25, 2014, 11:58:10 PM »

Hello,

we have been working with detailView, and found that when calling updateRow on a row which is currently expanded, the detail simply disappears, the row doesn't collapse or anything, but the detail is simply gone.

The result is as follows:


This has can be seen reproduced here : http://jsfiddle.net/4uw4x2ww/4/
we have implemented an updateRow method on every rowClick on the master, so by expanding a row and then clicking on it you can see the detail disappear.

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


View Profile Email
« Reply #1 on: August 26, 2014, 01:35:43 AM »

Please see the updated example http://jsfiddle.net/4uw4x2ww/5/
Logged
eliraz
Newbie
*
Posts: 12


View Profile Email
« Reply #2 on: August 26, 2014, 01:57:32 AM »

Hey.

While in the provided example this may be a viable workaround, in our real application the inner grid is dynamic and requests its own data from the server when it is expanded, and its loading time takes a lot longer, meaning that our performance will suffer greatly from this collapse-expand workaround.

Is there a different fix?

Thank you.
« Last Edit: August 26, 2014, 02:04:01 AM by eliraz » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: August 26, 2014, 02:43:45 AM »

When call 'updateRow' method to update a row's content, the detail content will also be updated. Your detail content is defined as:
Code:
detailFormatter:function(index,row){
return '<div style="padding:2px"><table class="ddv"></table></div>';
},

So the detail sub grid loses. You have to create it again. To prevent from clearing the detail content, please set the 'canUpdateDetail' property of view to false. The updated example below shows how to do this.
http://jsfiddle.net/4uw4x2ww/6/
Logged
eliraz
Newbie
*
Posts: 12


View Profile Email
« Reply #4 on: August 26, 2014, 04:20:10 AM »

It works!

Thank you very much.
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!