|
DbNetgrid Client Methods |
Top Previous Next |
|
Adds a linked child DbNetGrid or DbNetEdit to the parent grid. Linked controls should have their properties assigned before being passed as an argument to the addLinkedControl method. There is no need to call the initialize method for linked controls as this is done automatically.
Adds a nested child grid to the parent grid. The handler parameter specifies the function that will contain the nested grid configuration code and is passed a reference to the child grid for configuration.
Adds a button to the toolbar. Returns A reference to the button
addToolbarElement( index, tagName) Adds a button to the toolbar. Returns A reference to the button
Binds a client-side function to an event
Builds a chart image based on the supplied chart configuration object
Returns the grid value for the specified column name and grid row.
Returns a array of objects containing column values for the selected database records. All property names are lowercase.
executeSingletonQuery(sql, parameters) Returns an object containing column values for the selected database record. All property names are lowercase.
Returns an array of arrays representing the currently selected data in the grid. Data in the grid is returned as strings, dates and number types depending on the type of the database column.
getInputControl(columnName, row) Returns a reference to an input control when the grid is in edit mode.
Initializes the control and returns the first page of data. The method is called after all the grid properties have been assigned. Reloads the current page of data or the page containing the primaryKey (if supplied)
refreshListOptions(columnName, options, row) Refreshes the items in the drop-down list when the grid is in edit mode. The drop-down list is identified by columnName in the specified row. If options is specified then it can be either a JavaScript array or an SQL statement. If not specified the column lookup property is used to populate the list.
Refreshes the currently selected row from the database Returns an object containing primary values for the currently selected row Returns an array of table row elements that are selected. setColumnExpressions(columnNames) Specifies the columns that are selected from the table or view specified in the fromPart property
<script>
jQuery(document).ready( init )
function init()
{
var dbnetgrid1 = new DbNetGrid("dbnetgrid1");
with (dbnetgrid1)
{
connectionString = "SamplesDatabase"
fromPart = "Suppliers"
setColumnExpressions("CompanyName","Address","City","Phone","Fax");
setColumnLabels("Company Name","Addr","Town","Work Phone","Fax");
initialize()
}
}
</script>
setColumnFilter(columnName, value) Sets the value of a column filter
Specifies the labels for the columns specified in setColumnExpressions
<script>
jQuery(document).ready( init )
function init()
{
var dbnetgrid1 = new DbNetGrid("dbnetgrid1");
with (dbnetgrid1)
{
connectionString = "SamplesDatabase"
fromPart = "Suppliers"
setColumnExpressions("CompanyName","Address","City","Phone","Fax");
setColumnLabels("Company Name","Addr","Town","Work Phone","Fax");
initialize()
}
}
</script>
setColumnProperty(columnName, propertyName, propertyValue) Assigns a property value to the specified column (or columns) Parameters
Setting an individual property for a single column
<script>
jQuery(document).ready( init )
function init()
{
var dbnetgrid1 = new DbNetGrid("dbnetgrid1");
with (dbnetgrid1)
{
connectionString = "SamplesDatabase"
fromPart = "Orders"
setColumnExpressions("CustomerID","EmployeeID","OrderDate","ShipVia","ShipCountry");
setColumnProperty("CustomerID","label", "Customer");
setColumnProperty("CustomerID","lookup", "select customerid, companyname from customers");
setColumnProperty("CustomerID","filter", true);
setColumnProperty("EmployeeID","label", "Employee");
setColumnProperty("EmployeeID","lookup", "select employeeid, lastname from employees");
setColumnProperty("EmployeeID","filter", true);
setColumnProperty("OrderDate","filter", true);
setColumnProperty("ShipCountry","filter", true);
setColumnProperty("ShipVia","lookup", "select shipperid, companyname from shippers");
setColumnProperty("ShipVia","filter", true);
initialize()
}
}
</script>
Setting an individual property for a multiple columns
<script>
jQuery(document).ready( init )
function init()
{
var dbnetgrid1 = new DbNetGrid("dbnetgrid1");
with (dbnetgrid1)
{
connectionString = "SamplesDatabase"
fromPart = "Orders"
setColumnExpressions("CustomerID","OrderID","OrderDate","Freight","RequiredDate");
setColumnProperty(["OrderID","OrderDate","Freight"],"search",false)
initialize()
}
}
</script>
setColumnProperty(columnName, properties) Assigns multiple property values to the specified column Parameters
Setting an multiple properties for a single column
<script>
jQuery(document).ready( init )
function init()
{
var dbnetgrid1 = new DbNetGrid("dbnetgrid1");
with (dbnetgrid1)
{
connectionString = "SamplesDatabase"
fromPart = "Orders"
setColumnExpressions("CustomerID","EmployeeID","OrderDate","ShipVia","ShipCountry");
setColumnProperty("CustomerID",{label : "Customer", lookupSearchMode : "SearchText", lookup : "select CustomerID, CompanyName from Customers" })
initialize()
}
}
</script>
Gets a reference to the specified toolbar element. Parameters
Binds a client-side function to an event
|