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

Glossary Item Box

 WebGrid Properties

Version Description
Gets the complete version number of the WebGrid object including the build version number.

ValueType
string

Default Value
-
MajorVersion Description
Gets the major version number of the WebGrid.

ValueType
string

Default Value
-
RequiredFrameworkVersion Description
Gets the required Intersoft WebUI Framework version.

ValueType
string

Default Value
-
LayoutSettings Description
Gets the LayoutSettings which is the central object that contains all the behaviors and styles of the WebGrid control.

ValueType
object (LayoutSet)

Default Value
-
RootTable Description
Gets the WebGridTable object that is used as the root table in the WebGrid.NET control.

ValueType
object (WebGridTable)

Default Value
-
ScriptDirectory Description
Gets the directory path of the script files.

ValueType
string

Default Value
-
Enabled Description
Gets the value that indicates whether the WebGrid control is enabled.

ValueType
boolean

Default Value
true
Visible Description
Gets the value that indicates whether the control is visible.

ValueType
boolean

Default Value
true
Name Description
Gets the name of the grid.

ValueType
string

Default Value
-
TotalLoadedRows Description
Gets the number of the loaded rows.

ValueType
integer

Default Value
-
TotalRows Description
Gets the total number of rows that are assigned to the grid, including to be loaded ones.

ValueType
integer

Default Value
-
CultureInfo Description
Gets the current CultureInfo code of the grid object.

ValueType
string

Default Value
-
EnableV3XAPISupport Description
Gets the value of a property that indicates whether WebGrid V3.x APIs are supported.

ValueType
boolean

Default Value
false
ResizerStyle Description
Gets or sets the style of the object used to represent vertical resizing bar.

ValueType
string

Default Value
"position: absolute; z-index: 299; width: 2px; background-color: gray; display: none;"
SelectedHeaderBackColor Description
The backcolor of selected column header.

ValueType
string

Default Value
"black"
SelectedHeaderForeColor Description
The forecolor of selected column header.

ValueType
string

Default Value
"white"
HidePadColumn Description
Hides the pad column (a small section of the column headers above the vertical scrollbar).

ValueType
boolean

Default Value
false
NeedHeightResize Description
Sets the value that tells the grid whether it needs to resize its own height after one of its rows has been removed/hidden on client side.

ValueType
boolean

Default Value
false
NeedWidthResize Description
Sets the value that tells the grid whether it needs to resize its own width after one of its columns has been removed/hidden on client side.

ValueType
boolean

Default Value
false
IsInProgress Description
Gets or sets the grid state that indicates whether it is in processing request.

ValueType
boolean

Default Value
false
LastRequestObj Description
Gets the object used to process the last request.

ValueType
object

Default Value
-
LastAction Description
Gets the action name of the processed last request.

ValueType
string

Default Value
-
ValEngine Description
Returns the grid's validation engine object.

ValueType
object

Default Value
-
ExportTypeList Description
Gets or sets the export types displayed in the Export context menu.

ValueType
string (array)

Default Value
"HTML", "PDF", "XML"
ExportWndAttr Description
Gets or sets the window attributes for the export output.

ValueType
string

Default Value
"toolbar= no, menubar= yes, scrollbars= yes, resizable= yes"
LastError Description
Gets the last error message of the grid.

ValueType
string

Default Value
-
EditCtlTopAdj Description
Adjustment to top position of edit control relatively.

ValueType
integer

Default Value
-
EditCtlLeftAdj Description
Adjustment to left position of edit control relatively.

ValueType
integer

Default Value
-
PosRelativeTo Description
Sets where the grid is relatively located. Use this property to resolve the textbox offset position issue when the grid is inside a complex table or div structure while in edit mode.

ValueType
object (HTML Element)

Default Value
-
CheckedRowContext Description
Gets the checked-row context menu object.

ValueType
object

Default Value
-
HeaderContext Description
Gets the header context menu object.

ValueType
object

Default Value
-

 WebGrid Methods

IsClassicPaging Description
Determines whether the WebGrid is using classic paging mode.

Parameters
-

Remarks
-

Return Value

boolean

Samples
-
GetCurrentPage Description
Gets the current page of the data in the grid.

Parameters
-

Remarks
-

Return Value

int

Samples
-
GetTotalPages Description
Gets the total pages of the data in the grid.

Parameters
-

Remarks
-

Return Value

int

Samples
-
GotoFirstPage Description
Switches to the first page of the data in the grid.

Parameters
-.

Remarks
-

Return Value

void

Samples
 
function MoveFirst()
{
    var grid = ISGetObject("WebGrid1");
    grid.GotoFirstPage(); 
}
GotoLastPage Description
Switches to the last page of the data in the grid.

Parameters
-

Remarks
-

Return Value

void

Samples
 
function MoveLast()
{
    var grid = ISGetObject("WebGrid1");
    grid.GotoLastPage();
 }
GotoPreviousPage Description
Switches to the previous page of the data in the grid.

Parameters
-

Remarks
-

Return Value

void

Samples
 
function MovePrevious()
{
    var grid = ISGetObject("WebGrid1");
    grid.GotoPreviousPage();
}
GotoNextPage Description
Switches to the next page of the data in the grid.

Parameters
-

Remarks
-

Return Value

void

Samples
 
function MoveNext()
{
    var grid = ISGetObject("WebGrid1");
    grid.GotoNextPage();
}
GotoPage Description
Switches to specific page of the data in the grid.

Parameters
targetPageNumber ( int )
The number of the targeted page.

Remarks
-

Return Value

void

Samples
 
function MovePage()
{
    var grid = ISGetObject("WebGrid1");
    grid.GotoPage(5);
}
CreatePagingSlider Description
Creates the paging slider bar in the grid.

Parameters
containerId ( string )
The container's ID.

sliderId ( string )
The slider's ID.

Remarks
-

Return Value

Slidebar object

Samples
This function alerts the column name and type of a double-clicked cell.

function CreateSlider()
{
    var grid = ISGetObject("WebGrid1");
    var slider = grid.CreatePagingSlider("SliderContainer", grid.Id + "_slider");
    
    slider.SliderSize = 16;
    slider.SliderImage = "./images/vista_slider_thumb.gif";
    slider.Width = ISPosLib.getWidth(document.getElementById("SliderContainer"));
    slider.Initialize();

    // create the slider object, instantiate it, and assign it to PagingSliderBar
    grid.PagingSliderBar = slider;

    UpdatePageStatus();
}
SynchronizeSliderUI Description
Synchronizes the slider state to reflect the current state every time after the paging action is done.

Parameters
-

Remarks
-

Return Value

void

Samples
function SynchronizeSlider()
{
    var grid = ISGetObject("WebGrid1");
    grid.SynchronizeSliderUI();
}
GetColumnByElement Description
Gets the WebGridColumn object given the column element.

Parameters
el ( object - column element )
A column HTML element object.

Remarks
-

Return Value

object (WebGridColumn)

Samples
This function alerts the column name and type of a double-clicked cell.

function onCellDblClick(gridId, tblName, rowIndex, cellIndex, cellElm) {
    var grid = ISGetObject(gridId);
    var wgCol = grid.GetColumnByElement(cellElm);
    
    alert("wgCol's type: " + wgCol._Type + " " +
        "wgCol's column name: " + wgCol.Name);
    
    return true; 
}
GetCellByElement Description
Gets the WebGridCell object given the cell element.

Parameters
el ( object - cell element )
A cell HTML element object.

Remarks
-

Return Value

object (WebGridCell)

Samples
This function alerts the double-clicked cell text.

function onCellDblClick(gridId, tblName, rowIndex, cellIndex, cellElm) {
    var grid = ISGetObject(gridId);
    var cell = grid.GetCellByElement(cellElm);
    alert(cell.Text);
    return true; 
GetRowByElement Description
Gets the WebGridRow object given the row element.

Parameters
el ( object - row element )
A row HTML element object.

Remarks
-

Return Value

object (WebGridRow)

Samples
This function alerts the type of the row each time a user selects a row.

function DoRowSelect(controlId, tblName, rowIndex, rowElm)
{
    var grid = ISGetObject(controlId);
    var row = grid.GetRowByElement(rowElm);
    alert(row.Type);
    return true;
}

GetElement Description
Gets any element by specifying valid values in the parameters.

Parameters
gridPart ( constant )
The constant that represents the part of the grid, for example: WG40.COLHEADER.

htmlPart ( constant )

The constant that represents the HTML part of the grid, for example: WG40.HTMLTABLE.

Remarks
-

Return Value

object (HTML element)

Samples
This function alerts the text on the left-hand side of the status bar.

function LeftStatusBarText()
{
    var grid = ISGetObject("WebGrid1");
    var cell = grid.GetElement(WG40.STATUSBAR, WG40.HTMLCELL);
    alert(cell.innerText);
}

SetStatus1 Description
Sets the left-most grid status text.

Parameters
text ( string )
The text to be applied.
attr ( string )
This parameter is no longer required in WebGrid v3.5.
lgAttr ( string )
The language TextItem key. If this parameter is supplied, the text parameter should be set to empty, e.g: CommonText/Ready.

Remarks
-

Return Value

void
Samples
This function sets the left-hand side text of the status bar to "I'm ready".

function setStatus1()
{
    var grid = ISGetObject('WebGrid1');
    grid.SetStatus1("I'm ready.");
}

SetStatus2 Description
Sets the right-most grid status text.

Parameters
text ( string )
The text to be applied.
attr ( string )
The language TextItem key. Set this to 'loaded' if you want to display loaded row status.
p1 ( integer )
The number of the loaded rows.
p2 ( integer )
The number of the total rows in the data source.

Remarks
-

Return Value

void

Samples

function setStatus2() {
    var grid = ISGetObject('WebGrid1');
    grid.SetStatus2("Obtained");

SendCustomRequest Description
Invokes OnTheFly PostBack and pass custom data to the server.

Parameters
-


Remarks
-

Return Value

void

Samples

var grid = ISGetObject('WebGrid1');
grid.SendCustomRequest();

ClearSelectedObject Description
Clears selected object of the grid.

Parameters
-


Remarks
-

Return Value

void

Samples

var grid = ISGetObject('WebGrid1');
grid.ClearSelectedObject();
GetSelectedObject Description
Gets the last selected object.

Parameters
-


Remarks
-

Return Value

object (SelectedObject)

Samples

 

function ObtainRow()
{
    var grid = ISGetObject("WebGrid1");
    if (grid.GetSelectedObject() == null)
    {
        alert("Please select a row."); return;
    }
    var wgRow = grid.GetSelectedObject().GetRowObject();

 
GetDefaultLanguageXml Description
Returns the XML document object for the default language.

Parameters
-


Remarks
-

Return Value

object (XML Document)

Samples



function buttonClick()
{
    var grid = ISGetObject('WebGrid1');
    var xmlDoc = grid.GetDefaultLanguageXml();
    alert(xmlDoc.src);
}

GetLanguageXml Description
Returns the XML document object for the language.

Parameters
-


Remarks
-

Return Value

object (XML Document)

Samples

This function alerts the source of the XML document object.

function buttonClick()
{
    var grid = ISGetObject('WebGrid1');
    var xmlDoc = grid.GetLanguageXml();
    alert(xmlDoc.src);

GetString Description
Returns the string representation of the language XML document object.

Parameters
lgAttr ( string )
The TextItem's name.

Remarks
-

Return Value

string

Samples

function buttonClick()
{
    var grid = ISGetObject('WebGrid1');
    var strXml = grid.GetString();
    alert(strXml);

Refresh Description
Invokes refresh action to the grid. This method will refresh only the data.

Parameters
-


Remarks
-

Return Value

void

Samples

var grid = ISGetObject('WebGrid1');
grid.Refresh();

RefreshAll Description
Invokes full refresh action to the grid. This method will refresh the whole grid, including the grid structure. For instance, if the column structure has changed, the changes will be picked up upon calling this method.

Parameters
-


Remarks
-

Return Value

void

Samples

var grid = ISGetObject('WebGrid1');
grid.RefreshAll();
HasFocus Description
Determines whether the grid currently has the focus.

Parameters
-


Remarks
-

Return Value

boolean

Samples

 

var grid = ISGetObject('WebGrid1');
alert(grid.HasFocus());
HasGroup Description
Returns true if the grid has a grouped column or a child table.

Parameters
-


Remarks
-

Return Value

boolean

Samples

 

var grid = ISGetObject('WebGrid1');
alert(grid.HasGroup());
ActivateEditMode Description
Activates the grid's edit mode.

Parameters
isDirty ( boolean )
Specifies whether the edit mode activation will automatically mark the edit control dirty.

Remarks
-

Return Value
void

Samples
var grid = ISGetObject('WebGrid1');
grid.ActivateEditMode(false);
ExitEditMode Description
Quits the edit mode when an edit control is active (displayed).

Parameters
isCancel ( boolean )
Specifies whether the edit mode will be ended with cancel flag.

Remarks
-

Return Value

boolean
Samples
ISGetObject('WebGrid1');
grid.ExitEditMode(false);
ExitEdit Description
Exit from row editing completely. If a row has been modified (dirty), calling this method with success reasonFlag will update the active row.

Parameters
reasonFlag ( integer )
The reason flag that causes the row edit mode to be ended.
flag2 ( object )
Various flag, depends on reasonFlag.
flag3 ( object )
Various flag, depends on reasonFlag.

Remarks
-

Return Value
void

Samples

var grid = ISGetObject('WebGrid1');
grid.ExitEdit(1, 0, 0);
UpdateState Description
Updates the grid state.

Parameters
-


Remarks
-

Return Value
void

Samples



var grid = ISGetObject('WebGrid1');
grid.UpdateState(); 
HideGroupByBox Description
Hides the GroupByBox.

Parameters
-


Remarks
-

Return Value
void

Samples

var grid = ISGetObject('WebGrid1');
grid.HideGroupByBox();

IsGroupByBoxShown Description
Returns a value that indicates whether the GroupByBox is currently shown.

Parameters
-


Remarks
-

Return Value
boolean

Samples

var grid = ISGetObject('WebGrid1');
alert(grid.IsGroupByBoxShown());

 
ShowFilterBar Description
Displays the filter bar.

Parameters
-


Remarks
-

Return Value
void

Samples

var grid = ISGetObject('WebGrid1');
grid.ShowFilterBar();
HideFilterBar Description
Hides the filter bar.

Parameters
-


Remarks
-

Return Value
void

Samples

var grid = ISGetObject('WebGrid1');
grid.HideFilterBar();

IsVisible Description
Returns a value that indicates whether the grid is visible.

Parameters
-


Remarks
-

Return Value
boolean

Samples

var grid = ISGetObject('WebGrid1');
alert(grid.IsVisible());

SetBusy Description
Marks the grid status as busy. When a grid is busy, we have to wait until the grid is set to idle before we can invoke another action.

Parameters
-


Remarks
-

Return Value
void

Samples

 

var grid = ISGetObject('WebGrid1');
grid.SetBusy();

SetIdle Description
Marks the grid status as idle. When a grid is busy, we have to wait until the grid is set to idle before we can invoke another action.

Parameters
-


Remarks
-

Return Value
void

Samples

 

var grid = ISGetObject('WebGrid1');
grid.SetIdle();

GetBlurRowStyle Description
Gets the lost focus style.

Parameters
-


Remarks
-

Return Value
string

Samples

var grid = ISGetObject('WebGrid1');
var style = grid.GetBlurRowStyle();
alert(style);

 
GetEditFocusStyle Description
Gets the edit mode focus style.

Parameters
-


Remarks
-

Return Value
string

Samples

var grid = ISGetObject('WebGrid1');
var style = grid.GetEditFocusStyle();
alert(style);

MarkEdit Description
Marks the selected row of this grid to row edit mode.

Parameters
-


Remarks
-

Return Value
void

Samples 

var grid = ISGetObject('WebGrid1');
grid.MarkEdit();

GetCurSelImage Description
Returns the path of currently selected image file.

Parameters
-


Remarks
-

Return Value
string

Samples
-

Show Description
Sets the grid's visibility to visible.

Parameters
-


Remarks
-

Return Value

void
Samples
var grid = ISGetObject('WebGrid1');
grid.Show();
SetFocus Description
Sets the focus to this grid.

Parameters
-


Remarks
-

Return Value

void

Samples

var grid = ISGetObject('WebGrid1');
grid.SetFocus();
Hide Description
Sets the grid's visibility to hidden.

Parameters
-


Remarks
-

Return Value

void
Samples
var grid = ISGetObject('WebGrid1');
grid.Hide();
ExportGrid Description
Exports the grid to a document.

Parameters
tblName ( string )
The name of the table to be exported.
-
exportType ( string )
The type of the exported document, e.g: "HTML", "PDF".
-
pageOrientation ( string )
The page orientation of the exported document, e.g: "PORTRAIT", "LANDSCAPE".
-
parentRow ( object - row element )
The parent row of the sub table to be exported, required only when exporting sub table.

Remarks
-

Return Value
void

Samples 

var grid = ISGetObject('WebGrid1');
grid.ExportGrid("Customers", "PDF", "PORTRAIT");
GetActiveEditCell Description
Returns the currently active edit cell. This will return NULL if no cell is active.

Parameters
-


Remarks
-

Return Value

object (ActiveEditCell)

Samples
This function changes the innerText of the ActiveEditCell.

function buttonClick()
{
    var grid = ISGetObject('WebGrid1');
    var cell = grid.GetActiveEditCell();
    cell.element.innerText = "This cell content is changed";
}

GetLastEditObject Description
Gets the last EditObject during edit mode.

Parameters
-


Remarks
-

Return Value
object (EditObject)


Samples
This function alerts the EditObject's table name when a user presses the Enter key when the grid is in edit mode.

function onEditKeyDown(gridId)
{
    if (event.keycode == 13)
    {
        var grid = ISGetObject(gridId);
        var ac = grid.GetLastEditObject();
        alert(ac.tblName);
    }
    return true;

GetChangesCount Description
Returns the count of all pending changes regardless of the state and table.

Parameters
-


Remarks
-

Return Value
int


Samples
 
UpdatePendingChangesStatus Description
Synchronize pending changes with Grid�??s user interface elements

Parameters
-


Remarks
-

Return Value
void


Samples
 
UndoAllChanges Description
Undo all pending changes regardless of the state and table.

Parameters
-


Remarks
-

Return Value
void


Samples
 
AcceptAllChanges Description
Accept all pending changes and submit them to server for batch update.

Parameters
-


Remarks
-

Return Value
void


Samples
 
GetChanges Description
Returns a list of WebGridRowChange objects.

Parameters
rowState
Specifies the state of changes to get.

Remarks
-

Return Value
object (WebGridRowChange)


Samples
InvalidateChanges Description
Invalidate all pending changes to be reprocessed in the next synchronization.

Parameters
-


Remarks
-

Return Value
void


Samples
ClearChanges Description
Clear and remove all pending changes regardless of the state and table.

Parameters
-


Remarks
-

Return Value
void


Samples
 
SetDataSource

Description
Assign a new client-side datasource to WebGrid.

Parameters
datasource
The datasource to be assigned.

tableName
The table to be assigned.

Remarks
-

Return Value
void


Samples
 
GetConvertedDataSource Description
Gets the datasource that has been converted to CDOF-compatible object

Parameters
-


Remarks
-

Return Value
void


Samples
 
DataBind Description
Instructs WebGrid to perform data binding based on assigned datasource.

Parameters
-


Remarks
-

Return Value
void


Samples
 
LoadData Description
Instructs WebGrid to perform initial data loading.

Parameters
-


Remarks
-

Return Value
void


Samples
 
Render Description
Perform rendering based on bound data.

Parameters
-


Remarks
-

Return Value
void


Samples
 
RebindData Description
Rebind WebGrid with new datasource.

Parameters
dataSource

skipDataDispatch

Remarks
-

Return Value
void


Samples
 
©2012 Intersoft Solutions Corp. All Rights Reserved.