var fbTableUpdateCol = FbTablePlugin.extend({
initialize: function(tableform, options, lang) {
this.setOptions(tableform, options);
this.lang = Object.extend({'selectrow':'Please select a row!'}, lang || {});
window.addEvent('domready', function() {
this.tableid = this.tableform.getElement('input[name=tableid]').value;
this.watchButton();
}.bind(this));
},
watchButton:function() {
var button = this.tableform.getElement('input[name='+this.options.name+']');
if(!button) {
return;
}
button.addEvent('click', function(event) {
var e = new Event(event);
e.stop();
var ok = false;
this.tableform.getElements('input[name^=ids]').each(function(c) {
if(c.checked) {
var y=window.prompt("please enter a reason")
if (y!=null && y!="") {
ok = true;
} else {
ok = 'noreason';
return;
}
}
});
if(ok == false) {
alert(this.lang.selectrow);
return;
} else if(ok == 'noreason') {
return;
}
this.tableform.getElement('input[name=fabrik_tableplugin_name]').value = 'update_col';
this.tableform.getElement('input[name=fabrik_tableplugin_renderOrder]').value = button.name.split('-').getLast();
oPackage.submitfabrikTable(this.tableid, 'doPlugin');
}.bind(this));
}
});
Time to create page: 0.060 seconds