[ 8 posts ]

Rob Mottishaw

  • Username: mottrobe
  • Joined: Fri Apr 06, 2012 12:12 pm
  • Posts: 4
  • Offline
  • Profile

Nesting datatables and panels

Post Posted: Fri Apr 06, 2012 12:40 pm
+0-
I'm writing a summary click-through application that let's a user drill down deeper into details about the status of a report. In order to better explain, the first page shows a datatable that houses JSON data, where the user can select a row and obtain further information about the item in the row. I can create a panel and based on the row click, I create another XHR to retrieve more JSON information, for a datatable inside the panel, with one problem. I specify the panel element used in constructing the panel as the element used for the datatable and the datatable is there. The panel loses the close button, even though 'close' is true. Has anyone attempted this sort of thing?

Am I close or far off?

Here is the code for the original datatable, the panel coming from the original datatable event, and the datatable generated based on the rowClick event from the original datatable.

http://pastie.org/3741175.js

John Lindal

YUI Contributor

  • Username: jafl
  • Joined: Mon Nov 02, 2009 2:33 pm
  • Posts: 352
  • Location: Los Angeles, CA
  • Twitter: jafl5272
  • GitHub: jafl
  • Gists: jafl
  • Offline
  • Profile

Re: Nesting datatables and panels

Post Posted: Mon Apr 09, 2012 7:56 am
+0-
In some cases, there are nicer ways to allow the user to drill in:

Treeble provides drill-down when the columns are (at least mostly) the same: http://yuilibrary.com/gallery/show/treeble

Row expansion provides drill-down when you need to display arbitrary information: http://yuilibrary.com/gallery/show/data ... -expansion

Rob Mottishaw

  • Username: mottrobe
  • Joined: Fri Apr 06, 2012 12:12 pm
  • Posts: 4
  • Offline
  • Profile

Re: Nesting datatables and panels

Post Posted: Mon Apr 09, 2012 8:24 am
+0-
Thanks for your reply John. I need to mention that the datatables do not share the same column data, so a treeble wouldn't work, I had high hopes for your solution.

If I create a layout for the panel, would this help? Could I assign the second datatable to part of the layout in the panel?

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Nesting datatables and panels

Post Posted: Mon Apr 09, 2012 9:10 am
+0-
http://www.yuiblog.com/blog/2010/08/17/ ... expansion/

John Lindal

YUI Contributor

  • Username: jafl
  • Joined: Mon Nov 02, 2009 2:33 pm
  • Posts: 352
  • Location: Los Angeles, CA
  • Twitter: jafl5272
  • GitHub: jafl
  • Gists: jafl
  • Offline
  • Profile

Re: Nesting datatables and panels

Post Posted: Mon Apr 09, 2012 11:07 am
+0-
If you want the DataTable inside a panel, try creating a separate container for the panel, and put the DataTable inside that.

Rob Mottishaw

  • Username: mottrobe
  • Joined: Fri Apr 06, 2012 12:12 pm
  • Posts: 4
  • Offline
  • Profile

Re: Nesting datatables and panels

Post Posted: Mon Apr 09, 2012 12:47 pm
+0-
Thank you for that solution. In my requirements, each table has to open in a new panel, nested datatables was an option I considered but was told the look is too confusing for this project. Anyone else run into this?

Rob Mottishaw

  • Username: mottrobe
  • Joined: Fri Apr 06, 2012 12:12 pm
  • Posts: 4
  • Offline
  • Profile

Re: Nesting datatables and panels

Post Posted: Mon Apr 09, 2012 1:39 pm
+0-
John,

Create a div for the panel in the HTML, not in the script?

John Lindal

YUI Contributor

  • Username: jafl
  • Joined: Mon Nov 02, 2009 2:33 pm
  • Posts: 352
  • Location: Los Angeles, CA
  • Twitter: jafl5272
  • GitHub: jafl
  • Gists: jafl
  • Offline
  • Profile

Re: Nesting datatables and panels

Post Posted: Mon Apr 09, 2012 3:51 pm
+0-
It shouldn't matter whether you create a div for the panel in HTML or in JavaScript, as long as it is separate from the DataTable container.

Nested data tables are indeed too confusing and difficult to implement. That is why my row expansion module expects only a simple markup template.
  [ 8 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum