Hello!
I try to bind my form with combo element to grid:
grid.setColumnIds('product_name,serial,amount'); grid.setStyle("text-align: center; padding-left: 0px;", "", "", ""); grid.setInitWidths('*,150,150'); grid.setColSorting('str,str,int'); grid.setColTypes("ro,ed,ed"); grid.enableAutoWidth(true); grid.setFiltrationLevel(-1); grid.setColValidators(",,ValidInteger"); grid.enableAccessKeyMap(true); grid.init(); let formdata = [ { type: "block", width: "auto", blockOffset: 0, list: [ {type: "settings", position: "label-left", labelWidth: 80, inputWidth: 130}, { type: "combo", label: "Product Name", labelAlign: "right", labelWidth: "150", name: "product_name", inputWidth: "380", connector: "index.php?r=docs/additemsdata2", }, { type: "input", label: "Serial", value: "", labelAlign: "right", labelWidth: "150", name: "serial", inputWidth: "200", disabled: true }, {type: "newcolumn"}, { type: "input", label: "Amount", labelAlign: "right", labelWidth: "150", name: "amount", disabled: true }, {type: "block", width: "350", offsetTop: "50", offsetLeft: "200", list: [ {type: "button", value: "Отменить", name: "cancelButtonAddForm"}, {type: "newcolumn"}, {type: "button", value: "Добавить", offsetLeft: 20, name: "addButtonAddForm"} ] } ] }, ];
bindForm = wnd.attachForm(formdata);
bindForm.bind(grid);
bindForm.attachEvent(“onButtonClick”, function(name){
switch (name) {
case “addButtonAddForm”: bindForm.save(); break;
}
});
But Grid gets combo’s id to the product_name column. And I need that Grid gets a value of form’s combo. Would you help me what I need to do?