aslagle / reactive-table

A reactive table designed for Meteor
https://atmospherejs.com/aslagle/reactive-table
Other
328 stars 137 forks source link

Get Reactive table Id #445

Open monasha-s opened 8 years ago

monasha-s commented 8 years ago

How to get reactive-table id within the settings function?

I have multiple reactive table and i need to get the Id of the table within the settings function in template helpers.

aslagle commented 8 years ago

You can set the id yourself, so you'll know what it is. id is one of the options in settings. Make sure it's unique if you have multiple tables.

If you want reactive-table to generate it, you'd have to look it up in the DOM - find the table element with class 'reactive-table'.

monasha-s commented 8 years ago

I was having reactive table in loop

{{#each staffCode}} {{#with collectionDetails code}} {{> reactiveTable id=../code collection=this settings=settingsResult}} {{/with}} {{/each}}

So I need to know what was the code so I can do further computation in the 'settingsResult' helper

Using class 'reactive-table' may give me some other reactive-table id

aslagle commented 8 years ago

Ah, in that case you can use something like Template.parentData(1).code from the settingsResult helper.

Roshini369 commented 4 years ago

i need to get the fields based on the filter value. html file {{> reactiveTableFilter id="myFilter" label="Search" }} js file collection: Session.get('prizeArray'), filters: ['myFilter'], enableRegex: true, fields: [ { key: 'przStream', label: 'Stream' }, { key: 'przCode', label: 'Code'} ]

i need the current search filtered values displayed in fields.