DHTMLX Docs & Samples Explorer

getColumnNode(pId, index)

Returns DOM node for the specified column.

Required file: ext/dhtmlxform_dyn.js

Parameters:

  • pId - the parent item id, i.e. the id of the existing item which have subform with columns (null for top item)
  • index - (int) index of newcolumn
  • for radio button pId should be [pId, pValue]
var formData = [
    {type: "label", name: "columns", list: [
        // index=0
        {type: "select", label: "SELECT", options:[
            {value: "1", text: "*", selected: true},
            {value: "2", text: "userId"},
            {value: "3", text: "userName"}
        ]},
        {type: "newcolumn"},
        // index=1
        {type: "select", label: "FROM", options: [
            {value: "1", text: "users", selected: true}
        ]}
    ]}
];
var myForm = new dhtmlXForm("form_box", formData);
 
// for column 0
var column0 = myForm.getColumnNode("columns", 0);
column0.style.paddingLeft = "2px";
column0.style.paddingRight = "6px";
column0.style.backgroundColor = "#7CFC00";
 
// for column 1
var column1 = myForm.getColumnNode("columns", 1);
column1.style.paddingLeft = "4px";
column1.style.paddingRight = "4px";
column1.style.backgroundColor = "#FFFF00";