copy muliple row data from popup list to field

deant

Active Member
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

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);
    }
});
 
Hmmmm. Our popup architecture changed dramatically between 2.1 and 3.0. And again, between 3.0 and 3.1. This may not be trivial.

Where is the code that opened the list in the popup? What you pasted above seems incomplete.

-- hugh
 
Here is the second part of code located in /com_fabrik/js form_x.js:

Code:
function open_my_Window() {
 
var id = 'ItemsPopupWin';
var url= 'index.php?option=com_fabrik&view=table&tableid=39&tmpl=component&resetfilters=0';
 
this.windowopts = {
'id': id,
title: 'Selesct',
contentType: 'xhr',
loadMethod: 'xhr',
evalScripts:true,
contentURL: url,
width: 420,
height: 380,
 
'minimizable': false,
'collapsible': true,
onContentLoaded: function(){
oPackage.resizeMocha(id);
}
};
 
var mywin = new MochaUI.Window(this.windowopts);
};

Function open_my_Window is trigged on buton click locatede on form_x. If you like to see what I like to achieve and how code works I can PM you link to the page and login.
P.S. All code above was written Rob about 2 years ago. Maybe we should ask Rob for help... lol
Thx for your reply.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top