Code:
////////////////////////////////////////////////////////////////
// Custom editor for column 'section1.column5'
function page1_section1_column5_customeditor(controlsource,row,col)
{var employees = Lianja.getCursor("employees");
econt = createObject("econt","container");
econt.layout = "Form";
econt.addRow("", "formheading", "label");
formheading.caption = "EDIT EMPLOYEE DETAILS";
formheading.fontsize = 12;
formheading.alignment = "center";
formheading.backcolor = "lightslategray";
formheading.forecolor = "white";
econt.addRow("First Name:", "firstname", "textbox");
firstname.controlsource = "employees.firstname";
econt.addRow("Last Name:", "lastname", "textbox");
lastname.controlsource = "employees.lastname";
econt.addRow("Address:", "address", "textbox");
address.controlsource = "employees.address";
econt.addRow("City:", "city", "textbox");
city.controlsource = "employees.city";
econt.addRow("Region:", "region", "textbox");
region.controlsource = "employees.region";
econt.addRow("Postcode:", "postalcode", "textbox");
postalcode.controlsource = "employees.postalcode";
econt.addRow("Country:", "country", "textbox");
country.controlsource = "employees.country";
econt.backcolor = "lightgray";
econt.addRow("", "buttons", "container");
buttons.backcolor = "lightgray";
buttons.layout = "Horizontal";
buttons.spacing = 5;
buttons.addObject("cancelbtn", "commandbutton");
cancelbtn.caption = "Cancel";
// set the stylesheet classes for the button to theme it like a bootstrap button
cancelbtn.stylesheet = "btn btn-sm btn-block btn-default";
cancelbtn.click = function()
{
Lianja.get("page1.section1").grid.cancel();
};
buttons.addObject("savebtn", "commandbutton");
savebtn.caption = "Save";
// set the stylesheet classes for the button to theme it like a bootstrap button
savebtn.stylesheet = "btn btn-sm btn-block btn-default";
savebtn.click = function()
{
Lianja.get("page1.section1").grid.save();
};
buttons.minheight = 34;
econt.fixedheight = 254;
return econt;
};
Notice how the "Form" is created using the addRow() method of the container which has a "Form" layout.
Bookmarks