charlespockert / aurelia-bs-grid

Aurelia and Bootstrap powered datagrid control

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Main table sub table

eaidland opened this issue Β· comments

Hi @charlespockert !

Not an issue, but didn't know where else to write the question.

Is it possible to have a main table and a sub table. Where the sub table is shown and populated only when one selects a row in the main table?

Thanks πŸ‘

It's possible in a few ways. A simple way is to bind selectedItem in the first grid to a property on your viewmodel to track if something is selected.

If you make the property @bindable you can subscribe to changes using Aurelia's change notification <propertyname>Changed(newValue, oldValue)

When this changes you can then call refresh on the 2nd grid and ensure the read method gets the correct parameters (the read method can look at the selected item property for the first grid to determine what to load)

What about row click trigger? Bad Idea?

     <grid-row click.trigger="$parent.$parent.getSelectedProjectChildren($item)">

That will also work! Bit more wordy than binding selected-item though :)

Will rewrite code tomorrow. @party :)

Sendt fra min iPhone

Den 3. okt. 2015 kl. 19.31 skrev Charles Pockert notifications@github.com:

That will also work! Bit more wordy than binding selected-item though :)

β€”
Reply to this email directly or view it on GitHub.