Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column selector widget responsive is not working on safari #739

Closed
bibitoo opened this issue Oct 4, 2014 · 9 comments
Closed

Column selector widget responsive is not working on safari #739

bibitoo opened this issue Oct 4, 2014 · 9 comments

Comments

@bibitoo
Copy link

bibitoo commented Oct 4, 2014

I've got it work in chrome , on iphone 5 responsive body column is hidden, but the table header still there! Any help would be appreciated!

@thezoggy
Copy link
Collaborator

thezoggy commented Oct 4, 2014

does our example work? thus is it only your code?

@bibitoo
Copy link
Author

bibitoo commented Oct 4, 2014

The example isn't responsive on iphone 5, it show all content as on pc.

@bibitoo
Copy link
Author

bibitoo commented Oct 4, 2014

I've tested my code on chrome, it work perfect.

@bibitoo
Copy link
Author

bibitoo commented Oct 4, 2014

code

        //create sortable table
        var tbl = '  <table id="'+settings.name+'ListTable" class="table table-striped table-bordered table-condensed ">';
        tbl += '<thead><tr>';
        tbl += '<th  class="sequence">';
        tbl += '<label class="checkbox"><input type="checkbox" class="checkAll">'+ (settings.messages[6]) + '</label>';
        tbl += '</th>';

        tbl += '<th  class="lk-sequence">';
        tbl +=  (settings.messages[7]) ;
        tbl += '</th>'; 
        for( var column=1; column<settings.columns.length; column++){
            tbl += '<th  data-priority="'+column+'">'+settings.columns[column].label+'</th>';
        }
        tbl += '</tr></thead>';
        tbl += '<tfoot><tr><td  colspan="'+(settings.isShowSequence?settings.columns.length+1:settings.columns.length)+'">';
        tbl +='<div class="pagination tablepager pagination-right">';
        tbl += '<ul >'+
        '<li class="first"><a href="#" >&laquo;</a></li>'+
            '<li class="prev"><a href="#" >&lsaquo;</a></li>'+
            '<li class="pagenav" style="display:none"><a href="#" ></a></li>'+
            '<li class="next"><a href="#"  >&rsaquo;</a></li>'+
            '<li class="last"><a href="#">&raquo;</a></li>';
        tbl += '</ul>';
        tbl +='</div>';
        tbl += '</td></tr></tfoot>';
        tbl += '<tbody></tbody>';
        tbl += '</table>';

//sorter options
        var sorterOptions = {
                headers: tableheaders,           
                sortList: sortList,
                    widgets: [ 'columnSelector',"uitheme", "stickyHeaders", "zebra"] ,
                    widgetOptions:{
                        columnSelector_mediaquery: true,
                         columnSelector_priority : 'data-priority'
                    }

                };
 $('#'+settings.name+'ListTable',paginationList).tablesorter(sorterOptions);

@Mottie
Copy link
Owner

Mottie commented Oct 4, 2014

Hi @bibitoo!

I don't know why there is a difference between Safari and Chrome since they are both webkit browsers. If you are only having an issue with the widget on a mobile device, try adding this meta tag to your page <head>:

<meta name="viewport" content="width=device-width" />

I did find a minor issue with the widget when there are no set priorities, but I don't think it's related to this issue.

@bibitoo
Copy link
Author

bibitoo commented Oct 5, 2014

Hi @Mottle,
I've add this tag

<meta name="viewport" content="width=device-width, initial-scale=1.0">

I use bootstrap 2.3.2, Is the widget's css conflict with bootstrap on safari?

@Mottie
Copy link
Owner

Mottie commented Oct 5, 2014

When the widget hides a column, it adds css similar to this:

/* .tablesorter0000 is a unique class name added to each table */
.tablesorter0000 tr th:nth-child(2),
.tablesorter0000 tr td:nth-child(2) {
  display: none;
}

and if media queries are active, css similar to this is added to the page:

/* .tablesorter0000 is a unique class name added to each table */
@media only all { .tablesorter0000 tr th:nth-child(2),.tablesorter0000 tr td:nth-child(2) { display: none; } }
@media all and (min-width: 40em) { .tablesorter0000 tr th:nth-child(2),.tablesorter0000 tr td:nth-child(2) { display: table-cell; } }
@media all and (min-width: 50em) { .tablesorter0000 tr th:nth-child(3),.tablesorter0000 tr td:nth-child(3) { display: table-cell; } }
@media all and (min-width: 60em) { .tablesorter0000 tr th:nth-child(4),.tablesorter0000 tr td:nth-child(4) { display: table-cell; } }
@media all and (min-width: 70em) { .tablesorter0000 tr th:nth-child(5),.tablesorter0000 tr td:nth-child(5) { display: table-cell; } }

So it shouldn't interfere, but the specificity of those selectors may not be enough to override other selectors that you have on your page.

@bibitoo
Copy link
Author

bibitoo commented Oct 5, 2014

Thanks Mottle, I'll try to find it out why

@Mottie
Copy link
Owner

Mottie commented Oct 27, 2014

I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue this discussion.

@Mottie Mottie closed this as completed Oct 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants