Intersoft WebGrid Documentation
WebGridSubTables
Send comments on this topic.
Intersoft WebGrid > Client-side References > WebGridSubTables

Glossary Item Box

 WebGridSubTables Properties

SubId Description
Gets the SubID part of the SubTable.

ValueType
string

Default Value
-
TblName Description
Gets the table name that owns this SubTable.

ValueType
string

Default Value
-
GridId Description
Gets the grid ID that owns this SubTable.

ValueType
string

Default Value
-
Id Description
Gets the ID of the WebGrid SubTable.

ValueType
string

Default Value
-
ParentPos Description
Gets the parent row position of the SubTable.

ValueType
integer

Default Value
-
Position Description
Gets the row position of this SubTable.

ValueType
integer

Default Value
-
UniqueConstraints Description
Gets the list of unique constraints available in this Table. If the constraints are more than one, it will be separated with ; character.

ValueType
string

Default Value
-
RelNames Description
Gets the key pair of the unique constraints' column names and its value in XML format.

ValueType
string

Default Value
-
PositionUpdated Description
Gets the updated position of the SubTable.

ValueType
integer

Default Value
-
Width Description
Gets the width of the SubTable.

ValueType
integer

Default Value
-

 WebGridSubTables Methods

GetContainer Description
Gets the HTML element that is the container of this SubTable.

Parameters

-

Remarks

-

Return Value
object (HTML Div Element)

Samples
Get SubTable Container

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetContainer().tagName);
        } 

        return true;
}
GetElement Description
Gets the HTML element of this SubTable.

Parameters
gridPart ( constant )
The WG40 Grid Part

htmlPart ( constant )

The WG40 HTML Part

Remarks

-

Return Value
object (HTML Element)

Samples
Get Table HTML Element

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetElement(WG40.BODY,
 WG40.HTML).innerText);
        }

        return true;
}
GetParentRow Description
Gets the parent row element that owns this table based on specified row.

Parameters

-

Remarks

Returns HTML RowElement for 'hidden hierarchical container row'.

Return Value
object (HTML RowElement)

Samples
Get parent row HTML Element

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetParentRow().innerText);
        }

        return true;
}
GetParentRecordRow Description
Gets the parent record row element that owns this SubTable.

Parameters

-

Remarks

-

Return Value
object (WebGridRow)

Samples
Gets parent record row

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetParentRecordRow().innerText);
        } 
 
        return true;
}
GetFooterCellByName Description
Gets the footer cell element of this SubTable.

Parameters
name ( string )
The column name

Remarks

-

Return Value
object (row element)

Samples
Get footer cell

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetFooterCellByName("CustomerID"));
        }        
        return true;
}
GetRow Description
Gets the row of this SubTable.

Parameters
pos ( integer )
The row index

Remarks

-

Return Value
object (WebGridRow)

Samples
Get row by index

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetRow(0).KeyValue);
        }        
        return true;
}
GetRowByKeyValue Description
Gets the row of this SubTable by providing Key Value.

Parameters
kv ( string )
The key value of the record

Remarks

-

Return Value
object (WebGridRow)

Samples
Gets the row by keyValue

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetRowByKeyValue("10355"));
        } 

        return true;
}
 
SelectRow Description
Selects and highlights the specified row index.

Parameters
pos ( integer )
The row index

Remarks

-

Return Value
void

Samples
Select the first row

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                firstSubTbl.SelectRow(1);
        }  
        return true;
}
GetRowsCount Description
Gets the number of rows in this SubTable.

Parameters

-

Remarks

-

Return Value
integer

Samples
Gets the number of rows

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetRowsCount());
        }  
        return true;
}
GetConstraintXml Description
Gets the XML Constraint of this SubTable

Parameters

-

Remarks

-

Return Value
object (xml)

Samples
Gets ConstraintXml text


function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetConstraintXml().text);
        } 

        return true;
}
  
GetTable Description
Gets the WebGridTable object

Parameters

-

Remarks

-

Return Value
object (WebGridTable)

Samples
Gets the table's name

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId);  
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetTable().Name);
        } 

        return true;
}
  
GetGrid Description
Gets the WebGrid object

Parameters

-

Remarks

-

Return Value
object (WebGrid)

Samples
Gets the WebGrid version

function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{      
        var grid = ISGetObject(gridId); 
        if (tblName == "Orders")
        {
                var subTblColl = grid.Tables[tblName].SubTableIds;
                var firstSubTbl = subTblColl[0];
                alert(firstSubTbl.GetGrid().Version); 
        } 

        return true;
}
©2012 Intersoft Solutions Corp. All Rights Reserved.