ce icon indicating copy to clipboard operation
ce copied to clipboard

Custom toolbars Font size display the last selected font size text for all cells

Open cgt-training2 opened this issue 4 years ago • 4 comments

Check the example given on this link of JEXCEL official site: https://bossanova.uk/jexcel/v4/examples/spreadsheet-toolbars in the example change font size of cell A1 to 14px then click on cell A2(having font size of 9 px) the drop down shows 14px. Second issue is that it doesn't allow cell A2 to select 14px on the go but if i select 15px or any other value then if i select 14px cell A2 changed to 14px.

Please help and provide solution for this issue.

cgt-training2 avatar Nov 29 '20 05:11 cgt-training2

For fix that, you should update all item on toolbar. Currently on Jexcel CE/Pro toolbar is not update by cell selected.

Try this :

onselection = function(el, x1, y1, x2, y2) {
       var obj = el.jexcel;
      // update toolbar items available in obj.toolbar
      // For example
       var selectFontSize = obj.toolbar.querySelector("[data-k=font-size]");
       selectFontSize.value = obj.records[y1][x1].style.FontSize;
   }
},

Now you shloud make for all items of toolbar where you want update when selection

GBonnaire avatar Dec 06 '20 09:12 GBonnaire

I will add that to the wish list for future releases.

pphod avatar Dec 10 '20 19:12 pphod

@paulhodel maybe add a fonction on item toolbar for update like « onupdate(DOMElement ItemToolbar, el) ? And when onselection on spreadsheet, call onupdate of each Item toolbar ?

GBonnaire avatar Dec 10 '20 20:12 GBonnaire

@Guillaume-Bo , Hello hope you're doing well.I applied suggested solution and it's working. thank you very much.

cgt-training2 avatar Jan 02 '21 13:01 cgt-training2