responsive 'data-hide' as a cart page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 лет назад
hi, I'm using the view cart logic to manage a custom table.
Only the responsive does not work (w410 or w480) Which js or css do I need to import on my view in order to manage it as on the cart page?

I have included the ~ / Views / Shared / _ColumnsTwo.cshtml (which contains several css and js but not enough)

   <div class = "table-wrapper">
                 <table class = "cart">
                        <tr class = "cart-header-row">
                             <th> <span class = "item-count"> # </ span> </ th>
                              <th class = "remove-from-cart" data-hide = "w410, w480"> Name
 
                              </ Th>
                              <th class = "sku" data-hide = "w410, w480"> Surname
                              </ Th>
                        </ Tr>
                 </ Table>
</ Div>
 
Thank you very much for helping
4 года назад
Hello dspriveri,

first of all, you would need to fix your table`s markup a bit, you should have the thead and tbody tags, like so:


    <div class="table-wrapper">
        <table class="cart new-table">
            <thead>
                <tr class="cart-header-row">
                    <th>Number</th>
                    <th class="remove-from-cart" data-hide="w410, w480">Name</th>
                    <th class="sku" data-hide ="w410, w480"> Surname</th>
                </tr>
            </thead>
            <tbody>

                <tr>
                    <td>Some number</td>
                    <td>Some name</td>
                    <td>Some surname</td>
                </tr>
            </tbody>

        </table>
    </div>


After you fix the markup following the example above, you need to call the footable method for your new table, since this is totally new content, and the footable was originally not meant to be used on pages without tables.

You can do so, with the following code:

$(document).ready(function() {
    $('.cart.new-table').footable();
});


Hope this was helpful.


Best regards,
Valentin.
2 года назад
Hi,

I am trying to use this solution too. But my case is that I have a working table. Then I try to replace the HTML inside the table by using AJAX and JQuery html() method. Even though my new HTML has data-hide attributes they are not applied and all the fields are shown. Do you have any ideas?

Thanks in advance
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.