rnmp/salvattore

JS doesn't add classes to HTML elements on Drupal 6

Opened this issue · 0 comments

Hi,

I would to use this JS style to display a list of content produce by drupal Views module.
So I get the right HTML output like :

<div class="view-content" id="grid" data-columns="">
        <div class="views-row views-row-1 views-row-odd views-row-first">
  </div>
  <div class="views-row views-row-2 views-row-even">
      </div>
  <div class="views-row views-row-3 views-row-odd">
</div>
  <div class="views-row views-row-4 views-row-even">
       </div>  
    </div>

But as you can see, data-columns isn't set, and classes aren't added to items.
Perhaps because I add attributes "id" and "data-columns" with jquery ? Like this :

$('#liste-vdl div.view-content').attr("id","grid");
$('#liste-vdl div.view-content').attr("data-columns","");

Do you have any idea about fix this ?
thanks