i have an,form items of type select (options) are not sending data to the GridConnector when i bind the form as shown.
PS: I have dhtmlxprocessor.js and the debug.js included, this code has been shortened for other updates which are working.The form input type items are working properly.The grid has a dataprocessor correctly initialised
//JS CODE
var str = [
{ type:"block" , name:"block_one", offsetLeft:"30", list:[
{ type:"select" , name:"departmentid", label:"Department", validate:"ValidInteger", inputWidth:143, required:true, offsetTop:"10", position:"label-top",connector:"./.. /php/servers.php?options=true&department=2" },
{ type:"select" , name:"acctive", label:"Account Activation", labelWidth:170, inputWidth:143, required:true, offsetTop:"15", position:"label-top", options:[
{ value:"Activated", text:"Account Activated" },
{ value:"Deactivated", text:"Deactivate Account" }
] },
{ type:"label" , name:"lab2", label:"Account Access Rights" },
{ type:"select" , name:"payroll_priv", label:"Privileges On Payrolls", validate:"ValidAplhaNumeric", labelWidth:170, inputWidth:143, required:true, offsetTop:"10", position:"label-top", options:[
{ value:"n", text:"No Privileges" },
{ value:"e", text:"Edit Only" },
{ value:"c", text:"Create & Edit" },
{ value:"a", text:"Full Control" }
] },
{ type:"select" , name:"employee_priv", label:"Privileges On Employees", validate:"ValidAplhaNumeric", labelWidth:170, inputWidth:143, required:true, offsetTop:"10", position:"label-top", options:[
{ value:"n", text:"No Privileges" },
{ value:"e", text:"Edit Only" },
{ value:"c", text:"Create & Edit" },
{ value:"a", text:"Full Control" }
] }
] }
];
var admins_form = admins_form_cell.attachForm(str);
admins_form.enableLiveValidation(true);
admins_form.attachEvent("onValidateError", function (input, value, result){
dhtmlx.message({type:"error", text:admins_form.getItemLabel(input).replace(/\*+ /g,'')+" is missing!"});
});
admins_form.bind(admins_grid);
#
#PHP CODE
#
<?php
session_start();
require("../config.php");
require("./connector/db_mysqli.php");
require("./connector/grid_connector.php");
$dbc= new mysqli(DB_SERVER ,DB_USER,DB_PASS, DB_NAME);
function update($data){
$departmentID = trim(intval($data->get_value('departmentid')));
$emp_priv = trim(strval($data->get_value('employee_priv')));
$pay_priv = trim(strval($data->get_value('payroll_priv')));
$active = trim(strval($data->get_value('active')));
$lid = $data->get_id();
global $grid;
$grid->sql->query("UPDATE admin_priv SET departmentid=".$departmentID.",employee_priv='".$emp_priv."',payroll_priv='".$pay_priv."' WHERE loginid=".$lid." LIMIT 1");
$grid->sql->query("UPDATE login SET email='".$email."',password=SHA1('".$password."'),active='".$active."' WHERE loginid=".$lid." LIMIT 1");
$data->success();
}//END update
/*CRUD processing triggers*/
$grid->event->attach("beforeUpdate", "update");
$grid->enable_log("./admins_grid.txt",true);
$loadSQL = "SELECT * FROM department INNER JOIN admin_priv USING(departmentid) INNER JOIN login USING(loginid) WHERE login.level='A' ";
$grid->render_sql($loadSQL,"loginid",",fname,lname,email,national_id,department_name,employee_priv,payroll_priv,active","password,level,departmentid,loginid");
PS: I have dhtmlxprocessor.js and the debug.js included, this code has been shortened for other updates which are working