Hi to all,
I m stuck in resolving some .js script which works perfect in Fabrik 2.1 in Fabrik 3.o.9 does not and I can't resolve problem. Hope to get some help here.
On a form I have a text filed and buttton. What I like to do is:
1. On button clik - open list_x in popup window
2. Select multiple items/checkbox
3. Copy selected items into text field, just item_name not entire row
4. Close popup window
For some help here is an old code
I m stuck in resolving some .js script which works perfect in Fabrik 2.1 in Fabrik 3.o.9 does not and I can't resolve problem. Hope to get some help here.
On a form I have a text filed and buttton. What I like to do is:
1. On button clik - open list_x in popup window
2. Select multiple items/checkbox
3. Copy selected items into text field, just item_name not entire row
4. Close popup window
For some help here is an old code
Code:
//class name needs to be the same as the file name
var my_select_rows = new Class({
initialize: function(table)
{
this.table = table; //the table js object
},
onAttach:function(){
var b = new Element('input', {'type':'button', 'value':'add',
'class':'button tableplugin',
'events':{
'click':function(){
var c = document.getElements('input[name^=id]').filter(function(c){
return c.checked == true;
});
if (c.length == 0) {
alert('Please select some rows');
}else{
var str = '';
c.each(function(i){
str += i.getParent().getParent().getElement('td').innerHTML + "\n";
});
parent.document.getElement('#list_xx___fieldname').setHTML(str);
oPackage.closeMocha('ItemsPopupWin');
}
}
}});
b.injectInside(this.table.form);
}
});