telerik / kendo-ui-core

An HTML5, jQuery-based widget library for building modern web apps.
http://www.telerik.com/kendo-ui
Other
2.53k stars 1.91k forks source link

Support user-defined names #1701

Closed tsvetomir closed 7 years ago

tsvetomir commented 8 years ago

This story includes an API, persistence and UI elements to support defining custom names.

The Spreadsheet already implements the internals needed to use the defined names in formulas.

tsvetomir commented 8 years ago

Early design mock-up for the UI: image

mishoo commented 8 years ago

This feature is almost done (on branch spread-user-names) and I'd like to get some feedback before I merge the branch in. Here are some notes.

Test in playground/spreadsheet/sheet.html.

First, a styling issue that perhaps @gyoshev can help with. To place the name editor to the left of the formula bar, I've used a <table> (see code). Looks almost good to me, but somehow the formula bar has a black border now (I guess the <table> prevents border-color from being inherited).

toolbar

If you prefer me to attempt to do it without <table> please let me know. Also, the name editor styles are still in playground.

Brief description of current functionality:

tsvetomir commented 8 years ago

Great work, Mihai :+1:

@ivanchev we'll also need to add the corresponding support in the server-side export module as well

gyoshev commented 8 years ago

I pushed some basic styling and used a few other-than-a-table elements. Currently looks like this, but it should be checked by @yordanov, too.

image

Currently, the UI does not use any widget, and has a separate rendering. Why not use the ComboBox, so that we inherit its keyboard support and styles?

mishoo commented 8 years ago

@gyoshev the bar looks much better, but the popup seems broken:

popup

I'll try to fiddle with the ComboBox. Indeed, keyboard support would be nice.

mishoo commented 8 years ago

@gyoshev I changed it to use a ComboBox. The only problem now is that when I mouse over a resize handle, the popup closes:

popup I suspect it's because the Spreadsheet's render is triggered, and it steals focus from the combo (maybe the clipboard stuff?) — any idea how to fix this?

gyoshev commented 8 years ago

The combobox seems great, nicely done!

The problem with hovering the resize handles is quite annoying. I believe it is triggered also when using all other drop-downs in the toolbar. A way to workaround this is to raise a flag in the worksheet object when a drop-down is opened, so that the resize handles do not trigger a refresh. Not very great, but the only other alternative that I can come up with is to pull out the resize handles outside the view rendering code, and that seems to be a bigger hack.

mishoo commented 8 years ago

Indeed, it's happening with the font family/size selectors. Not with the border or color pickers though, which is strange. I'll investigate further, perhaps there is an even simpler solution.

mishoo commented 8 years ago

@gyoshev this fixes it for the user names popup. Not great either, but I like it more than a flag on the spreadsheet.

tsvetomir commented 8 years ago

Stopping the mousemove propagation here actually seems pretty decent solution. And it reuses the flag that is already in the browser event code :) #saynotoflags