|
Methods |
Top Previous Next |
|
addInputControlButton(columnName) Creates a custom button adjacent to the edit field identified by the columnName parameter Returns A reference to the created button Parameters
Adds a linked child DbNetGrid or DbNetEdit to the control. 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 button to the toolbar. Returns A reference to the button
Binds a client-side function to an event
Returns the current value for an edit field for the supplied column name Returns The edit field value as a string
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 values for the selected database values. All property names are lowercase.
Returns a jQuery wrapped set (array) containing the input control. Reference to the actual control input control can be got by accessing element 0 of the array
...
var customerId = DbNetLink.components["dbnetedit1"].getInputControl("customerid").val()
...
...
var customerId = DbNetLink.components["dbnetedit1"].getInputControl("customerid")[0].value
...
Initializes the control and returns the first page of data. The method should be called after all the properties have been assigned. Initialises the edit control ready to insert a new record.
refreshListOptions(columnName, options) Refreshes the items in the drop-down list The drop-down list is identified by columnName. 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.
Selects the record uniquely identified by the supplied primary key object.
<script>
function selectCustomer(custID)
{
var pk = { CustomerID : custID}
dbnetedit1.selectRecord(pk);
}
</script>
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>
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>
setInputControlValue(columnName,value) Assigns a value to an input field and triggers any associated events Parameters
Gets a reference to the specified toolbar element. Parameters
|