Dear Monks:

I have question regarding using CGI::Ajax.

my CGI::Ajax registered function will return a table, and I want to control the table's style by using jquery plugin tablesorter

the result table is returned, but I just can not control the style of it, i.e, I can not sort the table with using the plugin tablesorter in calling function

major part of code is as below, these are just part of the code, if there are some punctuation problems, please ignore it

as you can see, the main program, "show_html", can sort the table, "metatable"; however, the return table, "resulttable" can not be sorted even if I put id='resulttable' there.

Could someone help me with this issue?

Thank you

my $cgi = CGI->new(); my $pjx = CGI::Ajax->new('js_fun'=>\&perl_fun); sub per_fun{ ... print $cgi->start_table({id=>'resulttable'}), ... } sub show_html{ //partial code print $html_fh $cgi->start_html( -title=>'Selected GEO MetaData', -style=> {-src=>[ "jquery-ui-1.8.20.custom.css", "jq_tablesorter/themes/green/style.css", "jq_ui_redmond/css/selectable.css", ] }, -script=>[ { -type => "text/javascript", -src => "$tempdir/jq/js/jquery-1.7.2.min.js" }, { -type => 'text/javascript', -src => "$tempdir/jq/jq_tablesorter/jquery.tablesort +er.min.js" }, { -type => 'text/javascript', -src => "$tempdir/jq/jq_ui_redmond/js/jquery-ui-1.8. +20.custom.min.js" }, q< $(document).ready(function(){ $("#metatable").tablesorter(); $("#resulttable").tablesorter(); )} .... $("#done").click(function(){ $("#metatable").slideUp(); js_fun(['val1'],['result1']); //ajax return false; }) ..... print $cgi->div({id=>'result1'}); ..... }

In reply to CGI::Ajax can not control returned table css style by lightoverhead

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.