|
Rank: Member Groups: Member
Joined: 10/28/2009 Posts: 15
|
Hi,
We recently bought EO, so I have several questions.
1. Is it possible to use standard DropDownList component as an editor for custom columns? If yes, how to link DDL and column? 2. Is it possible to use my component (inherited from TextBox) as an editor? It does special client side formatting during typing. 3. All your examples for custom columns to populate DDL use either direct coding or Repeater. Is any other way to do it?
If it doable any piece of code would be very helpful
Thanks
Michael
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can pretty much put anything inside CustomColumn, however there are a number of things you want to be aware of:
1. The Grid only maintains one such instance for all cells of the column. In another word, your editor template is being reused multiple times;
2. You must be able to set/retrieve your editor content with JavaScript in order to interact with the Grid;
3. You should not post back (raising server event) inside your editor UI directly. The Grid won't have any chance to update the cell data if you do so;
The sample uses a Repeater rather than standard DropDownList because in order to comply with #2 and #3, the DropDownList does not provide any additional benefits. You can still use it though.
You should be able to use your own TextBox component as well as long as it is possible to get/set your textbox value with JavaScript, which shouldn't be a problem because it is inherited from the standard TextBox control.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 10/28/2009 Posts: 15
|
Hi,
Thanks for quick responce. It sounds imazing to me. I really like your product.
I hope the last question is. How to link custom column and DDL or my TextBox component. Which propertie should I use. Any example.
Best regards Michael
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, The key is you need to implement two JavaScript functions, one to load cell value into your "editor" and one to get the updated value from your "editor". The Grid talks to your UI elements exclusively through these two functions. It does not care what component you use or how you implement these two functions, nor there is anything like "linking" your component with the custom column. Please see here for more details: http://doc.essentialobjects.com/library/1/grid/custom_column.aspxThanks
|
|
Rank: Member Groups: Member
Joined: 10/28/2009 Posts: 15
|
Hi, Thanks for clarifications, now it's clear.
Don't you think that it would be very convenient to have client side column editor events like OnChange or KeyDown, KeyUp. In this case you would give full access to the process of editing.
Thanks again Michael
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Michael wrote:Don't you think that it would be very convenient to have client side column editor events like OnChange or KeyDown, KeyUp. In this case you would give full access to the process of editing. You are very welcome and thanks for the suggestion. OnChange is already indirectly supported through ClientSideEndEdit. KeyDown and KeyUp are rarely needed if you use built-in columns, especially if you consider some built-in columns (MaskedEditColumn and DateTimeColumn) handles these two events. There is no point to support those on a custom column because you can do that directly inside your EditorTemplate anyway. In addition, there is also the issue about balancing between too little and too much. And unfortunately the perfect balance point various from person to person. In our case we abstract the CustomColumn interface to two functions so that you only need to implement two functions. Obviously if we enhance the interface to support more features then you will need to implement more functions (because the whole point of a custom column is so that you can have full control). Most people probably would not like that. :) Thanks
|
|
Rank: Member Groups: Member
Joined: 10/28/2009 Posts: 15
|
Hi,
Your position is clear, thanks. The only reason why I'm asking about these events is the way how MaskedEditColumn is implemented - it's a common problem of MaskEdit components. Our s/w deals with time (in, out, duration). To speed up entering data we assume that if user typed "30" - it's a thirty minutes (0:30), not hours. To solve my task with MaskedEditColumn I would have three segment mask: Number (00), Literal (:) and Number (00). When MaskedEdit column gets focus the first segment (in my case Number) will be focused and to be able to enter thirty min, for example, user needs to press "0" or "tab" key to move to minutes section (third segment) and that additional typing is a problem. May be there is another solution for this?
Thanks Michael
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I don’t think the built-in MaskedEdit column can do that. It appears that you will need to have your own textbox inside a CustomColumn so that you can handle key down event yourself. That is very much what a CustomColumn is for.
Thanks!
|
|