-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Spreadsheet custom editors #1710
Comments
One question that comes to mind, should we allow free text editing as well? |
@mishoo, don't know, actually. I can definitely see a case for the opposite behavior (limiting choices to a predefined set). Free text editing + choices sounds like a combobox kind of editor to me. If we support both editors and free form text editing, then we should figure out how to handle formula entry. Or, perhaps this is not an issue at all? @gyoshev - these look more like custom editor indicators, could we treat them as such? The rendering can handle such things, biggest complication as usual is the frozen panes. |
@Underlog about the formula input, it should probably remain as is — allow free text there. I couldn't find out in Google Docs how to enable custom editors, other than by data validation. When done like this, it still allows free text input; the popup is just a helper. And the formula bar remains a plain text field. I vote we do the same. |
@mishoo AFAIK that's the way to enable them in Excel, too. +1 for the GDocs behavior, quite usable. @Underlog I believe these can be rendered like the filtering indicators, and allow the popups to be populated with the necessary UI (static / virtual list or exotics). This will also cater for the ASP.NET AJAX integration. I'm not sure if we want to reuse existing components outside the popup? |
I like the google docs approach (validation = editor helper), too. The main advantage here is that this will give us persistence out of the box. Don't you think, however, that this is a design decision suitable for a product targeting end users? |
As usual we have to leave the option for the developers to come up with their own implementations. Perhaps an event or a set of events will be sufficient to allow implementing custom "custom editors". Templates don't seem like a good fit for the moment, due to the dynamic nature of the UI virtualization. |
In this case I don't think we can rely on validation alone, we'd have to keep the cell editor in a different property. How about an API like this: kendo.spreadsheet.registerEditor("foo", {
edit: function(range, pos, callback) {
// opens the editor for the given cell. I'm thinking pos
// will be useful to position it near the dropdown button
// (if it's a popup editor) but it could be a dialog as
// well. We leave it to users.
// the editor should invoke callback(value) when a value
// has been selected
},
close: function() {
// hide the editor
},
icon: "iconClass" // for the button
}); and we'll store the editor type in a new property bag, so one can say e.g. sheet.range("A5").editor("foo"); |
Started implementation on branch spread-editors. Currently it has the date picker (can be seen in So the date/list ones can be enabled via validation and will be built-in. For user-defined editors, though, what do you guys think about my proposal above? (new |
The |
The editors for #1675 and #1673 are in place and can be activated in the validation dialog (and there's a sample in Left to do on this issue (please add to the list if I'm missing something):
|
I'll also add end-user documentation to the list /cc @dmihaylo |
API documentation here — should I cherry-pick it into |
Seems great to me! And a demo would complete the story :) |
Merged. |
@Underlog I added a demo skeleton in |
I get an error in the "regular" demos:
|
Could it be because that method is defined in a new file? I did list it in kendo.spreadsheet.js though. |
Well, that should work as expected. The error suggests that the new file is not picked by the build, though. Can you check that the referenced file is rebuilt correctly? |
Seems to work fine on staging, so it's my setup. Sorry! |
@yordanov do you have any ideas for a prettier demo? See http://kendobuild/staging-kendo-ui/spreadsheet/custom-editors |
On IE11 colorpicker appears shrinked and positioned in top left corner. In staging-demo |
There's an error actually that occurs in Perhaps I'm not using it properly? In any case, it seems unrelated to the spreadsheet, but rather my implementation of the sample custom editor. |
Seems like a really weird IE issue. Just trying to Moving initialization of @Underlog should I push this fix? Edit: I don't think it can break anything. Pushed. |
Yeah another IE weirdness. not much I can say here. |
See #1710 (comment) The error possibly occurs because the DOM is modified between initialization of children and its usage. Still, no excuse for IE :-\
See #1710 (comment) The error possibly occurs because the DOM is modified between initialization of children and its usage. Still, no excuse for IE :-\
I can confirm that it is fixed, another IE bug down. |
Hi, Is there any way to pass some value to the edit variable ? kendo.spreadsheet.registerEditor("foo", {
}); |
The most requested UV item for the widget - rightfully so. Spreadsheet is all about data entry
http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/suggestions/10069785-spreadsheet-custom-editors
I think that there is plenty to explore here, but for we can start with date/time pickers -
#1675 and predefined items from a list - #1673
Note: the editors in question will be activated only when the cell enters an edit mode. We should also figure out the formula bar behavior when such cell is entered.
The text was updated successfully, but these errors were encountered: