将数据表Jquery ui集成到myycode中

时间:2013-07-31 15:25:48

标签: perl cgi

我想将表格样式集成到我的代码中。 http://www.codeproject.com/Articles/277576/AJAX-based-CRUD-tables-using-ASP-NET-MVC-3-and-jTa 但是这个例子是在Asp.net MVC3中,我不知道如何在我的perl代码中做到这一点

my @aRows;
my $aArray = Db::select({
        table => 'Students',
        condition => {           
        }   
});                       
for my $i ( 0 .. $#$aArray ) {    
    my $cRowId = $q->hidden('rowid', $aArray->[$i]->{'ID'});
    my $bt1    = $q->image_button({-src => '/media/images/delete_1.png',
                        -class   => 'del', 
                        -title   => 'delete', 
                        -name    => 'delete',
                        -value   => $aArray->[$i]->{'ID'},

    my $bt2   = $q->image_button({-src => '/media/images/edit_1.png',
                        -class => 'upd', 
                        -title => 'update', 
                        -name  => 'update',
                        -value => $aArray->[$i]->{'ID'},
               });                         
   push @aRows, ($cRowId, $q->Tr($q->td([$aArray->[$i]->{'Name'}, $aArray->[$i]->{'Surname'},$aArray->[$i]->{'Age'}])));
}

print $q->table({-border => '1px solid green',-align =>'center',  -width => '100%', -id => 'id_table'},
   thead($q->th(['Name', 'Surname', 'Age'])),
   @aRows,
);                               
print $q->submit({-type => 'submit', -id => 'submit_btn', -value => 'load'});
#print $q->input({-type => 'button', -class => 'button', -onclick =>     "window.location.href='insert.pl';", -value => 'Add'});
print $q->end_form;  
print $q->end_html;

0 个答案:

没有答案