getTupleIndex() |
It retrieves the index of the tuple in the dataset available in the Model.
Syntax
Script |
iIndex = modelId.getTupleIndex(oParameterArray,bApproximate) |
Parameters
Parameter |
Description |
---|---|
oParameterArray |
Array that denotes the list of parameters in the request and their values. |
bApproximate |
This is a boolean value that denotes whether the method should return the nearest matching tuple incase the tuple in not found. |
Return Value
iIndex |
Integer that denotes the position of the tuple in the dataset contained in the model. |
Remarks
This method searches within the data already available in the model and if the object is not found then the index of the object closest to it is retrieved if the bApproximate parameter is true else it returns '100'. If there is no data in the model then also it returns '100'.
Example
This sample code demonstrates how the property can be used.
//create an array with parameter and values var indexArray = new Array(); indexArray["EmployeeID"]="5"; // retrieve the tupleIndex var index = newModel.getTupleIndex(indexArray, true); //refresh the view if the tuple is found if(index)newModel.view.refreshRendere(index);