Get ids of checked rows in list with sourcerer article plugin

kouros91

Member
Hi.
I would like to get ids of checked rows in the current display list, but with a js or php code inside an article with sourcerer, and not through php or js plugin list. Is it possible to get theses ids ?
The idea is to create others function buttons like a horizonal menu.

Thank you for answer.
 
Sorry, got caught up in a hurricane.

So you need to do this "live" on the page in the browser? So when a user selects and unselects checkboxes, your code sees that, and gets the currently selected ones?

-- hugh
 
Ok. I hope all is ok for you.
I would like to add buttons (html buttons, not the fabrik buttons) (with php and js code in the article with sourcerer) and i would like to get selected rows ids of the display list when user click on my button. Yes i would like my code sees, gets selected rows ids.
But i don't know how get ids of the selected rows , outside the js or php list plugin. Do you understand me ? Can you help me ?
Thanks.

Nicolas
 
Last edited:
OK, I've just added a new method to the list JS, getCheckedRowIds(), so you can do ...

Code:
var ids = Fabrik.getBlock('list_X').getCheckRowIds();

That will return an array of primary keys (ids).

Replace X with the numeric ID of your list.

And obviously you'll need to update from github.

-- hugh
 
It doesn't work :(. I've just make a button to display a checked row id. With sourcerer , here is my code :

Code:
{source}

<button id="test" onClick="showid()";>test</button>

<script language="javascript" type="text/javascript">

function showid() {
var ids = Fabrik.getBlock('list_56').getCheckRowIds();
var phrase ='ids :'.ids[0];
alert (phrase);

}

</script>

<?php


?>
{/source}

When i select one row and i click on the button, the console sends me : Uncaught TypeError: Fabrik.getBlock(...).getCheckRowIds is not a function
I've updated with github. Is update from github ok ??
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top