jqGrid
└─hgGridEdit
public abstract class hgGridEdit
extends jqGrid
| Field Summary | |
|---|---|
| boolean | Enables/disables adding of record into the table |
| booolen | Decodes the input for update and insert opeartions using the html_entity_decode |
| boolean | Enables/disables deleting of record into the table |
| boolean | Enables/disables updating of record into the table |
| bolean | Allow a obtaining and sending the last id (in case of serial key) to the client. |
| string | Determines the type of accepting the input data. |
| boolean | Defines if the primary key is serial (autoincrement) |
| boolean | If true every CRUD is enclosed within begin transaction - commit/rollback |
| Fields inherited from hiGrid\jqGrid | |
|---|---|
| ExportCommand, SubgridCommand, cacheCount, customClass, customError, customFunc, dataType, datearray, debug, encoding, errorMessage, gSQLMaxRows, higridSC, jsonencode, logtofile, mongofields, mongointegers, oper, optimizeSearch, performcount, readFromXML, showError, table, version, xmlCDATA | |
| Method Summary | |
|---|---|
| void | setSuccessMsg(string msg) Set the message which will be send to client side grid when succefull CRUD operation is performed. |
| string | Return the primary key of the table |
| void | setPrimaryKeyId(string keyid) Set a primary key for the table |
| void | setTable(string _newtable) Set table for CRUD and build the fields |
| void | setBeforeCrudAction(string oper, string sql, array params) Run a sql command(s) before the operation from the CRUD. |
| void | setAfterCrudAction(string oper, string sql, array params) Run a sql command(s) after the operation from the CRUD is succefull. |
| array | Return the fields generated for CRUD operations |
| boolean | insert(array data) Insert the data array into the database according to the table element. |
| boolean | update(array data) Update the data into the database according the table element A primaryKey should be set. |
| mixed | Return the last inserted id from the insert method in cas getLastInsert is set to true |
| boolean | delete(array data, str where, mixed params) Delete the data into the database according the table element A primaryKey should be set. |
| protected boolean | Check for primary key and if not set try to obtain it Return true on success |
| void | editGrid(array summary, array params, string oper, bool echo) Perform the all CRUD operations depending on the oper param send from the grid and the table element If the primaryKey is not set we try to obtain it using hiGridDB::getPrimaryKey If the primary key is not set or can not be obtained the operation is aborted. |
| Methods inherited from hiGrid\jqGrid | |
|---|---|
| __construct, addUserData, buildSearch, debugout, execute, exportToCsv, exportToExcel, exportToPdf, getDbDate, getDbTime, getGridParams, getSqlElement, getStringForGroup, getUserDate, getUserTime, logQuery, parseSql, queryForObject, queryGrid, querySubGrid, rs2excel, rs2pdf, selectLimit, sendErrorHeader, setDbDate, setDbTime, setGridParams, setPdfOptions, setUserDate, setUserTime | |
public boolean $add = true
Enables/disables adding of record into the table
public booolen $decodeinput = false
Decodes the input for update and insert opeartions using the html_entity_decode
public boolean $del = true
Enables/disables deleting of record into the table
public boolean $edit = true
Enables/disables updating of record into the table
public bolean $getLastInsert = false
Allow a obtaining and sending the last id (in case of serial key) to the client.
public string $mtype = "POST"
Determines the type of accepting the input data. Can be POST or GET
public boolean $serialKey = true
Defines if the primary key is serial (autoincrement)
public boolean $trans = true
If true every CRUD is enclosed within begin transaction - commit/rollback
public void setSuccessMsg(string msg)
Set the message which will be send to client side grid when succefull CRUD operation is performed. Usually afterSubmit event should be used in this case.
public string getPrimaryKeyId()
Return the primary key of the table
public void setPrimaryKeyId(string keyid)
Set a primary key for the table
public void setTable(string _newtable)
Set table for CRUD and build the fields
public void setBeforeCrudAction(string oper, string sql, array params)
Run a sql command(s) before the operation from the CRUD. Can run a unlimited
public void setAfterCrudAction(string oper, string sql, array params)
Run a sql command(s) after the operation from the CRUD is succefull. Can run a unlimited
public array getFields()
Return the fields generated for CRUD operations
public boolean insert(array data)
Insert the data array into the database according to the table element. A primaryKey should be set. If the key is not set It can be obtained from hiGridDB::getPrimaryKey Return true on succes, false otherwiese.
public boolean update(array data)
Update the data into the database according the table element A primaryKey should be set. If the key is not set It can be obtained from hiGridDB::getPrimaryKey Return true on success, false when the operation is not succefull
public mixed getLastInsertId()
Return the last inserted id from the insert method in cas getLastInsert is set to true
public boolean delete(array data, str where, mixed params)
Delete the data into the database according the table element A primaryKey should be set. If the key is not set It can be obtained from hiGridDB::getPrimaryKey Return true on success, false when the operation is not succefull
protected boolean checkPrimary()
Check for primary key and if not set try to obtain it Return true on success
public void editGrid(array summary, array params, string oper, bool echo)
Perform the all CRUD operations depending on the oper param send from the grid and the table element If the primaryKey is not set we try to obtain it using hiGridDB::getPrimaryKey If the primary key is not set or can not be obtained the operation is aborted. Also the method call the queryGrid to perform the grid ouput