meetselva / fixed-table-rows-cols

Fixed Table Header and Columns
http://meetselva.github.com/fixed-table-rows-cols/
Other
77 stars 42 forks source link

Want to hide the rows by click the row title #44

Open mag2000 opened 7 years ago

mag2000 commented 7 years ago

I have the table and, want to hide the any particular row by first column click. This column is fixed column in table. I used the following command for testing. I give the table id is example.

I entered $('#example tr:first').hide();. it will hide the row but also hide the scroll bar and also disturbed the table.

Above testing I am doing for add the group of rows. When your click the icon in row it will show further rows, and when user click again hide the rows. This will become the table with group option.

For your review. I am attached the snap of the problem. if you have any solution please let me know. snap of the problem

Waiting for your reply Thanks & Best Regards

meetselva commented 7 years ago

Apologies, I couldn't get to spend time on the issues lately. As you may have noticed, the plugin build additional tables to make it look like fixed row/columns and controls the scroll. All that is setup perfectly on load time. The problem is, When the content is disturbed (width, height, value), the plugin does not detect the change and update the changes..

For now, the only quick work around I can suggest is to reinitialize the plugin again after the change.

To initialize, please try the below code and let me know if it worked for you.

$fixedTable = <your fixed table selector>; $fixedTable.closest('.ft_scroller').unbind('scroll'); $fixedTable.closest('.ft_rel_container').find('.ft_rc, .ft_cwrapper, .ft_rwrapper').remove(); $fixedTable.unwrap().unwrap().unwrap().removeClass('ui-widget-header').find('.ui-widget-content').removeClass('.ui-widget-content');

**Feel free to adjust the above code, it is just a rough code to remove all elements that plugin included to create a fixed row/column.

A working example: http://codepen.io/meetselva/pen/qNJNYQ - Try the 'Apply Plugin' button and the 'Destroy' button to see how the plugin code is reverted.

Note: Destroy does not fully revert all the changes. Changes such as width/align set to each TD/Table are not reverted. However, when the plugin is called again after changes, it will rebuild/adjust the width.

Also Do not forget to adjust the colModal if you are changing/removing the column.

mag2000 commented 7 years ago

Thanks for your prompt reply

As it will effect the entire screen, even user just hide only one row. This will have very unpleasant experience for users.

Please if you have any other solution share with me. I will try this as well for the time being. Thanks for help Best Regards

mag2000 commented 7 years ago

Sorry, did not mentioned before, that I am not removing column. When your click on the row, the some row hide or un-hide. Column will be the remain same.

Regards