Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript" charset="utf-8">
- $(document).ready(function(){
- $.ajax({
- url: '<%= data_source %>',
- dataType: 'json',
- success: function(data) {
- var directive = {
- 'tr.row' : {
- 'company<-companies':{
- 'td.name':'company.name',
- 'td strong.orders_count':'company.po_count',
- '@rel':'company.id',
- '@class':function(arg){
- var style = (arg.pos % 2 == 0) ? ' ' : ' alt';
- <% if defined? selected_id %>
- if(arg.item.id == <%= selected_id %>) style += ' active ';
- <% end %>
- return style;
- }
- },
- }
- };
- $('#companies-column table').render(data, directive).slideDown();
- }
- });
- });
- </script>
Add Comment
Please, Sign In to add comment