function BR2Enter(myname){
var s = Ext.get(myname).dom.value;
Ext.get(myname).dom.value = s.replace(/
/gi,"\r\n");
}
function GetVariable(varCode, cmbHiddenName, cmbLabelText){
var MyStore = new Ext.data.JsonStore({autoLoad:true, baseParams: {varName: varCode}, url: 'modules/main/js/getvartocombo.php', root: 'variables', fields: ['id', 'varname']});
var myusers = new Ext.form.ComboBox({
fieldLabel: cmbLabelText, hiddenName:cmbHiddenName,
store: MyStore, editable:false,
valueField:'id', displayField:'varname', readOnly:true, mode: 'local', triggerAction: 'all',
emptyText:'Select value ...', selectOnFocus:true, maxHeight:150
});
MyStore.load();
return myusers;
};
function GetVariableID(varCode, cmbHiddenName, cmbLabelText, cmbID){
var MyStore = new Ext.data.JsonStore({ autoLoad: true, baseParams: {varName: varCode}, url: 'modules/main/js/getvartocombo.php', root: 'variables', fields: ['id', 'varname']});
var myusers = new Ext.form.ComboBox({
fieldLabel: cmbLabelText, hiddenName:cmbHiddenName,
store: MyStore, editable:false,
valueField:'id', displayField:'varname', readOnly:true, mode: 'local', triggerAction: 'all',
emptyText:'Select value ...', selectOnFocus:true, id:cmbID, maxHeight:150
});
MyStore.load();
return myusers;
};
mywindow = 0;
function GridToPrint(config){
var TableText ="Таблица";
if(config.idGrid){
if(config.TableText) TableText = config.TableText;
var idListGrid = config.idGrid;
var myStore = Ext.getCmp(idListGrid).getStore();
var myCM = Ext.getCmp(idListGrid).getColumnModel();
if(mywindow!=0) mywindow.close();
mywindow = window.open('','MessageWindow','scrollbars=yes,menubar=yes');
var colCount = myCM.getColumnCount();
mywindow.document.write('');
mywindow.document.write("
");
var recCount = myStore.getCount();
mywindow.document.write("