Home > Software engineering >  Vb that how to choose the Ext grid. The grid line
Vb that how to choose the Ext grid. The grid line

Time:10-25

 & lt; DIV id=ext - gen324 class=x - grid3 - body> 


& nbsp;

This is a web page a checkbox in the source code (no box)

If the check box ticked the, this check box is website source code


1,
HtmlElement. Click
HtmlElement tested div, table, tr, td
Results: there were no effect,
2,
HtmlElement. SetAttribute "ClassName", "x - grid3 - row x - grid3 - row - selected"
HtmlElement is to be selected the line div
Results: the appearance appears to be selected, but the actual point related operation button (such as: edit, delete), system prompt: please select at least one data,

A method is called JS can online, but c # write
 int rowIndex=0; 
HtmlElement script=webBrowser1. The Document. The CreateElement method (" script ");
Script. The SetAttribute (" type ", "text/javascript");
Script. The SetAttribute (" text ", "the function test () {+"
"Var myGrid=Ext getCmp (' myGridId ');" +
"MyGrid. GetSelectionModel (), selectRow (" + rowIndex +");" +
"}
");
WebBrowser1. Document. The Body. The AppendChild (script).
WebBrowser1. Document. InvokeScript (" test ");

This code can be converted to VB code for me?

Dim rowIndex %, Script
RowIndex=0
Set the Script=Form1. WebBrowser2. Document. The createElement method (" Script ")
Script. The setAttribute "type", "text/javascript
"Script. The setAttribute "text", "the function test () {" & amp; "Var myGrid=Ext getCmp (' myGridId ');" & "MyGrid. GetSelectionModel (.) selectRow (" & amp; RowIndex & amp; ");" & "}
"Form1. WebBrowser2. Document. The body. The appendChild (Script)
Form1. WebBrowser2. Document. InvokeScript (" test ")

Whether the above write like this?
I carried out the "Form1. WebBrowser2. Document. InvokeScript (" test") "error: object doesn't support the properties and methods
Want to consult everybody, write the code above is wrong, or what good method is to choose the check box but will have the effect, thanks

CodePudding user response:

Didn't see the paper emphasizes the "check box" what it means to have no box, but you put the c # code less literal translation, at best is an VB.NET code, must not make VB6

CodePudding user response:

I'd like to in the VB WEBBROWER automatically the meaning of "check box" box, can have a method call?

CodePudding user response:

Oh, what are you use ExtJs3 or 4 ah, I was hoping to use the Extjs, but it seems it is difficult to set the font size, not too careful to see, the dojo appeared to be better?

CodePudding user response:

Thank you very much "bcrun" reply, in fact there is a web page is to do with ExtJs3, the inside of the web function calls made of JS file, only the JS file is "ExtJs3" to the inside,
This is the source code page (keep open) :










And the top (the building) code is invoked the JS file out to code to come to the,
I at ordinary times is to use VB WEBBROWSER to find good object, then use "click" event, to accomplish automatic box,
Now the object only "DIV" this layer, as for the other computer languages, I am not at all, can you provide the VB advice or method?
  • Related