Sigma Php Ajax framework, Ajax Components, GUI Builder
May 24, 2012, 10:41:25 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: jQuery selectors and dialog boxes  (Read 1597 times)
telegramsam1
Newbie
*
Posts: 3


View Profile
« on: May 31, 2011, 12:57:53 PM »

I am using a jQuery based plotting tool called 'Flot'. (Flot homepage: http://code.google.com/p/flot/)
Flot draws plots with code like this. Note that it loads jquery and flot libraries. (adaptation of: http://people.iola.dk/olau/flot/examples/basic.html)

<script language="javascript" type="text/javascript" src="../jquery.js"></script>
<script language="javascript" type="text/javascript" src="../jquery.flot.js"></script>
<div id="divID" style="width:600px;height:300px;"></div>
<script type="text/javascript">
$(function () {
    var d1 = [[0, 3], [4, 8], [8, 5], [9, 13]];
    $.plot($("#divID"), [d1]);
});
</script>

I managed to load the two libraries required to do the plotting. I want to draw a plot inside a dialog box. Flot requires me to identity a <div> by its ID so it knows where to draw the plot. This <div> needs to have a defined width and height so Flot knows how big the plot will be. I would like to know some way to know what the ID of the <div> of a dialog box is going to be.

The builder does assign a <div> to the inside of a dialog box, (something like "linb.UI.Dialog-PANEL:a:"), but it doesn't work when I refer to it. I get the error "uncaught invalid dimensions for plot(), width = null, height = null.

My plotting command works on a blank .html document. I want to draw the same plot but inside a dialog box.
Logged
linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #1 on: May 31, 2011, 09:41:22 PM »

1.  You can get the Inner panel DOM node: this.ctl_dialog.getSubNode('PANEL').get(0);

2. You can set the HTML: this.ctl_dialog.setHtml(html);      or this.ctl_dialog.getSubNode('PANEL').html(html);
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!