Ajax calls from inside of cells!

Ajax calls from inside of cells!

fefefefe Posts: 8Questions: 0Answers: 0
edited September 2011 in Feature requests
Hi!

I just found your jquery widget searching on the net a valuable JavaScript generated table and I found it fantastic. I would like to use it for a statistic tool. Through ajax call I'm filling out the fields of my data Table with values and so one to this point it's working. What I would like to do in the following: to evaluate this values with javascript and if there is a critical value make it linkable(another ajax call) and pop up a Highchart.

Is it possible to do this?

best regards

fefe

Replies

  • GregPGregP Posts: 487Questions: 8Answers: 0
    It must be possible. We have access to the data either in the DOM or if you need the hidden data, in the data object. DataTables is rich with opportunities to bind some sort of event that would cause a pop-up to appear.
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    edited September 2011
    I recommend using one of the jquery packages that provide popup windows (and handle all the ajax). I strongly favor Fancybox at the moment. http://fancybox.net/

    The gist of using fancybox is this:

    1) for your critical values, render your cell contents as a link, use a css class name of your preference
    i.e. value
    (you can use datatables callbacks, or use jquery, to find and render contents as critical values. see fnRender, or fnRowCallback or fnDrawCallback on http://www.datatables.net/ref)

    2) attach Fancybox to any of your critical values
    i.e. in fnDrawCallback which is called every time a page is drawn, call $(".criticalvalue").fancybox();
    you can pass an initialization object into fancybox() to set the popup height, width, colors, and various other options.. see the API/FAQ on the fancybox page for the various settings

    3) PROFIT!!!
  • fefefefe Posts: 8Questions: 0Answers: 0
    thanks for the responses I found it useful! I'm gonna give a try in the following days.

    best regards
This discussion has been closed.