2

So I was trying to add grid binding to an already finished grid that has string and date values. Example: http://www.sencha.com/examples/#ExamplePlace:gridbinding

╔═════════╦═════════════════════╗
║  room   ║      date/time      ║
╠═════════╬═════════════════════╣
║ L1-0056 ║ 25.02.2014 06:23:16 ║
║ L2-0061 ║ 25.02.2014 08:54:31 ║
╚═════════╩═════════════════════╝

Room: ComboBox with room values

Date/Time: Either DatePicker + some self-made TimePicker, or some DateTimePicker library... (getting the gxt-datepicker to work was easy, but I also need to edit the time)

Getting the date values into the editor and vice versa doesn't seem to be the problem (aside from the fact that I also need to edit the time).

There isn't any DateTimePicker in gxt, right? So... how do I define 2 editor fields for one cell in a grid?

Also: using a TextBox to edit the string in the first column works fine, but how can I use a ComboBox as editor?

As an alternative, I used inline-editing: http://www.sencha.com/examples/#ExamplePlace:inlineeditablegrid

In this case, everything works fine. Except the fact, that I still cannot edit the time in the date field with given picker. Not sure what method to pick here (either inline editor or binding) - but on both I cannot figure out how to edit the time-part in the date field, any ideas?

Either one is fine, as long as I get the editing to work.

[edit] the datetime picker part may be answered (thanks :) ), gotta give it a try - any ideas about the combobox-binding?

  • 1
    +1 Nice ascii art for your table, did you make it by hand or do you have a tool for this? – ReeCube Mar 17 '14 at 09:53
  • http://www.sensefulsolutions.com/2010/10/format-text-as-table.html – theblackkey Mar 17 '14 at 09:54
  • possible duplicate of [GWT Time Picker?](http://stackoverflow.com/questions/4509655/gwt-time-picker) – slugmandrew Mar 17 '14 at 11:28
  • nope, im not looking for a timepicker pre se. im looking for a combination of date and time. this twitter library bootstrap would do the job with the binding alternative, i guess (first example) - since i dont have any clue how to define a custom inline-editor for a datefield. – theblackkey Mar 17 '14 at 11:59
  • Well one solution would be to store the date and time as separate fields, then you could have a picker for each one, but I understand if that's not what you want. – slugmandrew Mar 18 '14 at 11:03

1 Answers1

0

I would recommend GWT-Bootstrap's DateTimePicker at http://gwtbootstrap.github.io/#component:datetimepicker

It brings up a time picker after the date has been selected:

enter image description here

As you say, there doesn't seem to be an equivalent in GXT.

I'd say you are better off with one widget so if you don't want to use another 3rd-party library then you'll have to roll your own composite widget.

slugmandrew
  • 1,776
  • 2
  • 25
  • 45
  • thanks. also with gwt-wrapper. alright, this would do the work with binding, if i went with the binding approach (not quite sure how to define this as inline-editor). maybe someone also has an idea about the combobox-binding? – theblackkey Mar 17 '14 at 11:49