JqxCheckBox: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Line 16: Line 16:


== Example (Basic) ==
== Example (Basic) ==
<pre>
Dim thisExchange, value
Dim thisExchange, value
thisExchange=""
thisExchange=""


Function xcbNYSE_onclick()
Function xcbNYSE_onchecked()
   thisExchange="Y"   
   thisExchange="Y"   
   MsgBox("You chose the New York Stock Exchange!")
   MsgBox("You chose the New York Stock Exchange!")
End Function
End Function


Function xcbNASDAQ_onchange()
Function xcbNASDAQ_onchecked()
   MsgBox("You chose the Nasdaq Stock Exchange!")   
   MsgBox("You chose the Nasdaq Stock Exchange!")   
End Function
End Function


Function xcbAMEX_onchange()
Function xcbAMEX_onchecked()
   value = $("#xcbAMEX").jqxCheckBox("val");
   value = $("#xcbAMEX").jqxCheckBox("val");
   if value=True Then
   If value=True Then
     MsgBox("You chose the American Stock Exchange!")   
     MsgBox("You chose the American Stock Exchange!")   
   End if
   End If
End Function
End Function


Line 43: Line 41:
   thisExchange=""
   thisExchange=""
End Function
End Function
</pre>
== Example (JavaScript) ==
var thisExchange, value;
thisExchange = "";
xcbNYSE.onchecked = function() {
    thisExchange = "Y";
    NSB.MsgBox("You chose the New York Stock Exchange!");
};
xcbNASDAQ.onchecked = function() {
    NSB.MsgBox("You chose the Nasdaq Stock Exchange!");
};
xcbAMEX.onchecked = function() {
    value = $("#xcbAMEX").jqxCheckBox("val");
    if (value == true) {
        NSB.MsgBox("You chose the American Stock Exchange!");
    }
};
Button1.onclick = function() {
    $("#xcbNYSE").jqxCheckBox("uncheck");
    $("#xcbNASDAQ").jqxCheckBox("uncheck");
    $("#xcbAMEX").jqxCheckBox("uncheck");
    thisExchange = "";
};
</pre>
</pre>



Revision as of 19:29, 8 December 2016

Description

The jqxCheckBox widget displays a check box that allows the end-user to select a true, false or indeterminate condition.

jqWidgets is a commercial product, which depending on how you use it, requires a license fee. Complete details are on jqWidget's website. The product is well supported.

To change the title of an item at runtime, use textContent:

xcbAMEX.childNodes[1].textContent = "American Express"

Properties and Methods

This control is well documented on the jqWidget's website: http://www.jqwidgets.com/jquery-widgets-documentation/.

Example (Basic)

Dim thisExchange, value thisExchange=""

Function xcbNYSE_onchecked()

 thisExchange="Y"  
 MsgBox("You chose the New York Stock Exchange!")

End Function

Function xcbNASDAQ_onchecked()

 MsgBox("You chose the Nasdaq Stock Exchange!")  

End Function

Function xcbAMEX_onchecked()

 value = $("#xcbAMEX").jqxCheckBox("val");
 If value=True Then
   MsgBox("You chose the American Stock Exchange!")  
 End If

End Function

Function Button1_onclick()

 $("#xcbNYSE").jqxCheckBox("uncheck"); 
 $("#xcbNASDAQ").jqxCheckBox("uncheck"); 
 $("#xcbAMEX").jqxCheckBox("uncheck"); 
 thisExchange=""

End Function

Example (JavaScript)

var thisExchange, value;

thisExchange = "";
xcbNYSE.onchecked = function() {
    thisExchange = "Y";
    NSB.MsgBox("You chose the New York Stock Exchange!");
};
xcbNASDAQ.onchecked = function() {
    NSB.MsgBox("You chose the Nasdaq Stock Exchange!");
};
xcbAMEX.onchecked = function() {
    value = $("#xcbAMEX").jqxCheckBox("val");
    if (value == true) {
        NSB.MsgBox("You chose the American Stock Exchange!");
    }
};
Button1.onclick = function() {
    $("#xcbNYSE").jqxCheckBox("uncheck");
    $("#xcbNASDAQ").jqxCheckBox("uncheck");
    $("#xcbAMEX").jqxCheckBox("uncheck");
    thisExchange = "";
};

Output

See sample.