The Business Logic tab enables you to add your own custom JavaScript functions that are called when each grid data cell is drawn.
Parameter |
Description |
---|---|
Enable Business Logic |
Indicates whether to enable the business logic feature. If enabled, you can add business logic in the form of JavaScript. If disabled, you cannot add business logic. By default, business logic is disabled. |
Business Logic JavaScript Function Declarations |
Enter a function call using JavaScript. The function is called when an update is submitted from the mobile device. See below for example code. |
Following is a sample function that is called when cells are displayed on a mobile device.
// This function will be called whenever each cell data // is drawn // cellValue : value of the data cell // function evaluateFunction(cellValue) { // cellValue is the value of the cell to be printed // The following show an example of changing the data // cell font color // to red and adding a link to call alertFunction when // click on // uncomment out to use /* createElement("A"); eleHref.href = "#"; eleHref.onclick = alertFunction; eleHref.style.color = "#FF0000"; eleHref.appendChild( document.createTextNode( cellValue ) ); return eleHref; */ // return string or DHTML object to be replaced // return cellValue; } // uncomment this out to use /* function alertFunction() { // the reference to this is the object declared to // this function var obj = this; // This will return the text that is clicked on var txt = obj.childNodes[0].nodeValue; alert("I have clicked on : " + txt); // If you want to show status or alert at the // bottom of the grid table use the following // showCustomData("My text here : " + txt); } */
In this example, when the user clicks a cell, the cell content is displayed in red (#FF0000) and the status or alert displays at the bottom of the grid table.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |