Deb,<br><br>I have been planning for a directive that would add ajax capabilities to an ordinary table (ajax sort, page forward/back), this would make it dead simple to add this functionality without doing any manual javascript work. The idea is to make this very easy to add to an existing table. Additional things could be done to do inline edit and stuff like that, but I will save that for later.
<br><br>Here is an idea for the syntax <br><br>It basically identifies what model we are pulling from, what columns, what the sort and secondary sort would be for each column (when you click on the heading to sort). It would generate the proper rhtml and partials under the covers and all the necessary javascript to click on headings etc. If you don't care about secondary sort then you can even eliminate the :sort param.
<br><br><table mv:ajax_grid="product, :cols => [:name, :desc, :date], :sort => [:column, :date]"><br><tr><th>Name</th><th>Description</th><td>Date</th></tr>
<br><tr><td>name1</td><td>desc1</td><td>date1</td></tr><br></table><br><br>or alternately specifying the columns using nested directives so that they could be rearranged in WYSIWYG editor. Directives can work with nested directives to accomplish interesting things or for that matter they can also read style or anything that is nested.
<br><br><table mv:ajax_grid="product, :sort => [ :column, :date ]"><br>
<tr><th>Name</th><th>Description</th><td>Date</th></tr><br>
<tr><td mv:column="name">name1</td><td mv:column="desc">desc1</td><td mv:column="date">12/31/2006</td></tr><br>
</table><br><br>and if we go the extra step to allow alternating row styles we could allow this, the below would apply rowStyle1, rowStyle2, and rowStyle3 to each row allowing a nice striping effect<br><br><table mv:ajax_grid="product">
<br>
<tr><th>Name</th><th>Description</th></tr><br>
<tr class="rowStyle1"><td>name1</td><td>desc1</td></tr><br>
<tr class="rowStyle2"><td>name2</td><td>desc2</td></tr><br>
<tr class="rowStyle3"><td>name3</td><td>desc3</td></tr><br>
<tr class="rowStyle1"><td>name4</td><td>desc4</td></tr><br>
<tr class="rowStyle2"><td>name5</td><td>desc5</td></tr><br>
<tr class="rowStyle3"><td>name6</td><td>desc6</td></tr><br>
</table><br>
<br><br>Let me know what you think. But these are the types of directives that I think really show off the power of MasterView. <br><br>Jeff<br>
<br>