Skip to main content
Nintex Community Menu Bar
Question

In a javascript button I want to check weather a table contains any row.How to do that

  • Jul 10, 2024 12:30 AM UTC
  • 3 replies
  • 53 views
  • Translate All

Forum|alt.badge.img+4

Hi all I have a javascript button in a tab where i want to check that a table has any row or not .Note this table is in another tab and and different object(model).How can I do that ?

3 replies

Forum|alt.badge.img+11

If memory recalls,

var myTable = $('#my-table').data('object');<br>var tableList = myTable.list;<br>var renderedItems = tableList.renderedItems;<br>$.each(renderedItems, function (i, item) {<br>&nbsp;&nbsp; console.log(i + ' - ' + item);<br>});



http://help.skuidify.com/m/11720/l/205336-skuid-ui-list


Translate

Forum|alt.badge.img+11

Note: if the tab has not been rendered then the table may not be in the DOM.  You will need to look into this.  You can alway query the model, however.

Translate

Forum|alt.badge.img+5
  • Nintex Partner
  • Jul 10, 2024 1:24 AM UTC

If you have a specific model on the other table you could do something like this:

var tableModel = skuid.$M("ModelForTable"); if(!!tableModel.data) { console.log('table contains row'); }
Translate