Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updating a jquery value -- HOW TO?
#1
Photo 
I have a gauge rendered on my form using the raphael jquery library.  The gauge renders correctly using the following code (placed inside a script property of a div element):

Code:
$('.PEERSON').kumaGauge({
   value : 20,
   showNeedle : false,
   valueLabel : {display : true,
                         fontColor : '#000',
                         fontSize : 20},
   title : {
       // show or hide this label
       display : true,
       // String the value of the title
       value : 'PEERS ON',
       // The font family of this label
       fontFamily : 'Arial',
       // The font color of this label
       fontColor : '#000',
       // Integer of The font size of this label (without px)
       fontSize : 20,
       // The font weight of this label
       fontWeight : 'normal'
    }
});

How can I change the "value" from Intraweb so that the gauge updates?  I know it's probably simple, but I can't see an easy way to update a jquery element's value from Delphi/Intraweb.

Any help would be greatly appreciated.
Reply
#2
(10-25-2019, 12:53 AM)pdinsd Wrote: I have a gauge rendered on my form using the raphael jquery library.  The gauge renders correctly using the following code (placed inside a script property of a div element):

Code:
$('.PEERSON').kumaGauge({
   value : 20,
   showNeedle : false,
   valueLabel : {display : true,
                         fontColor : '#000',
                         fontSize : 20},
   title : {
       // show or hide this label
       display : true,
       // String the value of the title
       value : 'PEERS ON',
       // The font family of this label
       fontFamily : 'Arial',
       // The font color of this label
       fontColor : '#000',
       // Integer of The font size of this label (without px)
       fontSize : 20,
       // The font weight of this label
       fontWeight : 'normal'
    }
});

How can I change the "value" from Intraweb so that the gauge updates?  I know it's probably simple, but I can't see an easy way to update a jquery element's value from Delphi/Intraweb.

Any help would be greatly appreciated.


If you use bootstrap library you can set up params to inizialiase the jquery selector and then use restevent to write result to the output. See more example on use bootstrap table in documentation.

Andrea
Reply
#3
Hi. Try something like this in you delphi side:
Code:
   WebApplication.CallBackResponse.AddJavaScriptToExecute(
      '$("#PEERSON").val("newvalue");'
   );
or
   WebApplication.CallBackResponse.AddJavaScriptToExecute(
      'IW.$("#PEERSON").value("newvalue");'
   );
Not tested ok. But the idea is here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)