1

I have been struggling to get the value of a dojoxGridCell. I have read through some helpful documentation by dojo here but am so far unable to get the value of the cell.

I am utilizing AutoHotkey Unicode 64-bit v 1.1.25.01, here is what I have so far:

#Persistent
#SingleInstance, force
SetTitleMatchMode, 2


ie := ComObjCreate("InternetExplorer.Application")
ie.Visible := 1
ie.Navigate("https://tmpa-fnsb.hs.mdmgr.net:8445")
While ( ie.Busy || ie.ReadyState != 4 )                                                                         ; Waits for the webpage to finish loading
    Sleep 10

WinMove, Cisco Finesse - Internet Explorer,,-842,313,843,324

ie.document.all.username.value := "USER"
ie.document.all.password.value := "PASS"
ie.document.all.extension.value := "EXT"
ie.document.all["signin-button"].click()
While ( ie.Busy || ie.ReadyState != 4 )                                                                         ; Waits for the webpage to finish loading
    Sleep 10

sleep 7000

Value:= grid.store.getValue(queueGrid.getItem(2), 3);
msgbox %Value%
Return

Because it's not publicly accessible, here is the DOM for the web page:

<div id="queueBody">
        <div id="queueGrid">
        <div tabindex="0" align="left" class="dojoxGrid" id="dojox_grid_DataGrid_0" role="grid" aria-multiselectable="true" aria-readonly="true" style="height: auto;" hidefocus="hidefocus" widgetId="dojox_grid_DataGrid_0" dojoattachevent="onmouseout:_mouseOut">
    <div class="dojoxGridMasterHeader" role="presentation" style="height: 39px; display: block;" dojoattachpoint="viewsHeaderNode"><div class="dojoxGridHeader" role="presentation" style="left: 1px; top: 0px; width: 1477px;" dojoattachpoint="headerNode">
        <div role="presentation" style="width: 9000em;" dojoattachpoint="headerNodeContainer">
            <div role="row" dojoattachpoint="headerContentNode"><table class="dojoxGridRowTable" role="presentation" style="width: 1460px;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr0" role="columnheader" aria-readonly="true" style="margin: 0px; padding: 0px 0px 0px 10px; width: 20%; border-left-color: currentColor; border-left-width: 0px; border-left-style: none;" aria-sort="ascending" rowspan="2" idx="0"><div class="dojoxGridSortNode dojoxGridSortUp"><div class="dojoxGridArrowButtonChar">▲</div><div class="dojoxGridArrowButtonNode" role="presentation"></div><div class="dojoxGridColCaption">Queue Name</div></div></th><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr1" role="columnheader" aria-readonly="true" style="width: 8%;" rowspan="2" idx="1"><div class="dojoxGridSortNode"># Calls</div></th><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr2" role="columnheader" aria-readonly="true" style="width: 8%;" rowspan="2" idx="2"><div class="dojoxGridSortNode">Max Time</div></th><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr3" role="columnheader" aria-readonly="true" style="width: 8%;" rowspan="2" idx="3"><div class="dojoxGridSortNode">Ready</div></th><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr4" role="columnheader" aria-readonly="true" style="width: 8%;" rowspan="2" idx="4"><div class="dojoxGridSortNode">Not Ready</div></th><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr5" role="columnheader" aria-readonly="true" style="text-align: center;" colspan="3" idx="5"><div class="dojoxGridSortNode">Active</div></th><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr6" role="columnheader" aria-readonly="true" style="text-align: center;" colspan="2" idx="6"><div class="dojoxGridSortNode">Wrap Up</div></th></tr><tr><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr7" role="columnheader" aria-readonly="true" style="width: 8%;" idx="7"><div class="dojoxGridSortNode">In</div></th><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr8" role="columnheader" aria-readonly="true" style="width: 8%;" idx="8"><div class="dojoxGridSortNode">Out</div></th><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr9" role="columnheader" aria-readonly="true" style="width: 8%;" idx="9"><div class="dojoxGridSortNode">Other</div></th><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr10" role="columnheader" aria-readonly="true" style="width: 8%;" idx="10"><div class="dojoxGridSortNode">Ready (Pending)</div></th><th tabindex="-1" class="dojoxGridCell " id="dojox_grid_DataGrid_0Hdr11" role="columnheader" aria-readonly="true" style="width: 8%;" idx="11"><div class="dojoxGridSortNode">Not Ready (Pending)</div></th></tr></tbody></table></div>
        </div>
    </div></div>
    <div class="dojoxGridMasterView" role="presentation" style="height: 36px;" dojoattachpoint="viewsNode"><div class="dojoxGridView" id="dojox_grid__View_1" role="presentation" style="left: 1px; top: 0px; width: 1477px;" widgetId="dojox_grid__View_1">

    <input class="dojoxGridHiddenFocus" role="presentation" type="checkbox" dojoattachpoint="hiddenFocusNode">
    <input class="dojoxGridHiddenFocus" role="presentation" type="checkbox">
    <div class="dojoxGridScrollbox" role="presentation" dojoattachpoint="scrollboxNode">
        <div class="dojoxGridContent" role="presentation" style="width: 1460px; height: 36px;" hidefocus="hidefocus" dojoattachpoint="contentNode"><div role="presentation" style="left: 0px; top: 0px; position: absolute;"><div class="dojoxGridRow" role="row" aria-selected="false"><table class="dojoxGridRowTable" role="presentation" style="width: 1460px;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="margin: 0px; padding: 0px 0px 0px 10px; width: 20%; text-align: left; border-left-color: currentColor; border-left-width: 0px; border-left-style: none;" rowspan="2" idx="0">TS_CL_SG_Primary</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" rowspan="2" idx="1">0</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" rowspan="2" idx="2">00:00:00</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" rowspan="2" idx="3">9</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" rowspan="2" idx="4">13</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" colspan="3" idx="5"></td><td tabindex="-1" class="dojoxGridCell " role="gridcell" colspan="2" idx="6"></td></tr><tr><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" idx="7">1</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" idx="8">0</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" idx="9">0</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" idx="10">0</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" idx="11">0</td></tr></tbody></table></div><div class="dojoxGridRow dojoxGridRowOdd" role="row" aria-selected="false"><table class="dojoxGridRowTable" role="presentation" style="width: 1460px;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="margin: 0px; padding: 0px 0px 0px 10px; width: 20%; text-align: left; border-left-color: currentColor; border-left-width: 0px; border-left-style: none;" rowspan="2" idx="0">TS_Int_SW_SG_Secondary</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" rowspan="2" idx="1">0</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" rowspan="2" idx="2">00:00:00</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" rowspan="2" idx="3">4</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" rowspan="2" idx="4">6</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" colspan="3" idx="5"></td><td tabindex="-1" class="dojoxGridCell " role="gridcell" colspan="2" idx="6"></td></tr><tr><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" idx="7">0</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" idx="8">0</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" idx="9">0</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" idx="10">0</td><td tabindex="-1" class="dojoxGridCell " role="gridcell" style="width: 8%;" idx="11">0</td></tr></tbody></table></div></div></div>
    </div>
</div></div>
    <div class="dojoxGridMasterMessages" style="display: none;" dojoattachpoint="messagesNode"></div>
    <span tabindex="0" dojoattachpoint="lastFocusNode"></span>
</div></div>
        <div class="clear"></div>
    </div>

The goal is to get the value inside this dojoxGridCell:

<td tabindex="-1" class="dojoxGridCell  dojoxGridCellFocus" role="gridcell" style="width: 8%;" rowspan="2" idx="3">5</td>

The messagebox always return empty. Please help, what am I doing wrong? Thank you.

1 Answers1

0

To get a cell value from the grid try this.

//Assume that we want to get a 4th cell value from 2nd row

var item = grid.getItem(1); //The 2nd row 
if(item){  
    grid.getCell(3).get(1, item); //The 4th column, the 2nd row 
} 

*********************updated answer******************** please see

http://jsfiddle.net/7NEEe/11/

I have an alert which displays 9.33 as the answer. I have hardcoded the row and cell numbers so you always see 9.33 on row click.

bajji
  • 1,271
  • 3
  • 15
  • 37
  • I tried your solution but the Elem variable returns empty still. See below: `item = grid.getItem(1)` `Elem := grid.getCell(3).get(1, item)` `msgbox %Elem%` – CodingToWork Apr 23 '18 at 14:24
  • I can see how it's working in the context of your script, but am struggling to translate that over to my situation. Is there a way to return the value of an entire row in an array? – CodingToWork Apr 23 '18 at 20:10
  • yes, you can return it. item holds the first row data i.e. data for all columns – bajji Apr 23 '18 at 20:17
  • word of caution: since datagrdi uses lazy loading, you may not get all the row values until it is displayed on the grid. if you want to get something which is not shown yet, I would suggest you to query the store directly. – bajji Apr 23 '18 at 20:19