Hide row number column
Is it possible to hide the row number column on the left of the table?
$('.jexcel_label').hide()
On Tue, Feb 5, 2019 at 6:34 PM bennyzr [email protected] wrote:
Is it possible to hide the row number column on the left of the table?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/paulhodel/jexcel/issues/288, or mute the thread https://github.com/notifications/unsubscribe-auth/AFvagcbtAux9J1qOOXOYgps1nBBnf-89ks5vKc6jgaJpZM4aj0Pz .
Interesting, thanks.
However, using this leaves me with an extra column on the left with a width of 30.
Interesting, thanks.
However, using this leaves me with an extra column on the left with a width of 30.
There is a place in jquery.jexcel.js where line no:462,472 where the table header and table content width is defaulted to 30. If you change it to 0 if you do not need the row number to display.
I was successfully able to hide the row number column and use for my requirement.
Your idea does get rid of the left column. However, the right most column is not accessible. It's a different style and you can't enter anything into the cells. Good, Fast, Cheap; Pick any two.
On Wednesday, February 6, 2019, 4:37:15 AM EST, avidsouza <[email protected]> wrote:
Interesting, thanks.
However, using this leaves me with an extra column on the left with a width of 30.
There is a place in jquery.jexcel.js where line no:462,472 where the table header and table content width is defaulted to 30. If you change it to 0 if you do not need the row number to display.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Commenting lines 462, 472, & 1502 in jquery.jexcel.js and classes .jexcel > div > table > thead > tr.jexcel_filter > td:first-child, .jexcel > div > table > tbody > tr > td:first-child in jquery.jexcel.css does the trick
I am going to add a method to do that, should commit that soon.
I am going to add a method to do that, should commit that soon.
Hi Paul can you please guide me on Issue reported on #286. Thanks in advance
On V3, showIndex(), hideIndex()
Hi,
I just tried using hideIndex() on V3 which removed the column though it kept the index number in the existing left most column. Shouldn't hideIndex() remove the index number as well? Also, any chance of adding this option to the init options?
How about hiding the column headers?
I used the following css to hide row numbers and the last column it leaves behind: .jexcel_selectall { display: none }
.jexcel_row { display: none }
colgroup>col:last-child { width:0; }
I guess this was resolved some time ago.
Oops ... you are right. Thanks Paul for pointing that out. I see now your reply "On V3, showIndex(), hideIndex()".
Thanks Paul. hideIndex() worked fine
@paulhodel is there a way to incorporate hideIndex() into the table object? something like this:
var myTable = jexcel(document.getElementById('spreadsheet'), {
url: '/gantt_data',
columns: headers,
onload: function(a, b) {
var count = headers.length;
for(var i=7;i<=count;i++){
b.headers[i].classList.add('employee');
}
},
hideIndex:true, <--------------- this
columnResize:false,
nestedHeaders:[
{
title: 'SCHEDULE',
colspan: headers.length-2,
},
],
});
couldnt work out how to name tabs to variables such as "myTable" to call hideIndex() so added no3 in the below list so its default - currently around line 500 but search for "Content table" as is the comment in the file. Side note on tabs when I empty the "spreadsheet" div ready to load another then it leaves class="jexcel_tabs" (on "spreadsheet" div) which causes the next load to error.. Currently I have to both empty the "spreadsheet" div and remove the class... to have a global var "myTable" clears the loading error if "$(myTable).remove()"; but there are still tab issues as in the tabs (new table) the old tabs get added to.
// Content table obj.table = document.createElement('table'); obj.table.classList.add('jexcel'); obj.table.classList.add('jexcel_hidden_index'); // added this - removes index column as a default obj.table.setAttribute('cellpadding', '0'); obj.table.setAttribute('cellspacing', '0'); obj.table.setAttribute('unselectable', 'yes');
document.getElementById('spreadsheet').jexcel.hideIndex();
not working in chrome... had tried that (and many more) using Jquery selector... tried with your vanilla and does not work... it did not work before I discovered tabs and so I learnt to assign the table to a variable (myTable) => when you called it against a non tab table using myTable.hideIndex() it worked... the same does not work for tabs nor does yours or anything else I can find... nice plugin still finding my feet with it but I cant do it without the above as commented EDIT: Put it on a timeout to give the table plenty of time to load - just in case - nope cant get anything to work - my suggestion would be put it as an option as suggested by 3AUCE Also suggests that I am not going to be able to call methods against the tabs but we will see - getting ahead of myself
If you wish to create an example on jsfiddle I am happy to take a look.
https://jsfiddle.net/shropford/t6bcg1Ld/16/
Done.. note that if you remove the removeClass("jexcel_tabs") on line 2 then switching from tabs and then back has issues... now my set up may be wrong but it works - so I dont know...
For anyone finding this issue
table.jexcel colgroup col:first-child {
width: 0 !important;
}
does the trick pretty nicely.