语言

Menu
Sites
Language
Custom Data-Picker possible?

Hi,

I'm currently working on a simple app and facing a problem. I see the date-picker widget and liked the way how you could pick the date and time (see picture) and tried to use this way for an custom data-picker, but I didn't get it work the same way.

So is it possible to use this endless scrolling style for an own data-picker, e.g. to select a temperature? Cause I get only normal list-views to work in a popupwindow, but no horizontal endless scrolling stuff :(

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

6 回复
Daehyeon Jung
  In current implementation of the Date Time Picker, you can not use directly.  You might be better implement custom picker based on popupwindow with VirtualGrid widget. You can refer here: https://developer.tizen.org/help/topic/org.tizen.web.uiwidget.apireference/html/widgets/widget_virtualgrid.htm Or, you can refer DateTimePicker's source code. I am pretty sure you can make another your own widget if you understand the code. Here is the raw code link: https://review.tizen.org/git/?p=framework/web/web-ui-fw.git;a=tree;f=src/widgets/datetimepicker/js;h=698894f47b2befb22ca5f37a0ffac010d8254393;hb=HEAD It is based on circularview widget which is a kind of private api; which means, there is a chance to change on the circularview's api without notice. So, I recommend you first way; using virtualgrid widget. Regards        
Stephan König
I tried the virtual grid widget, but I didn't get it to work. The Tizen documentation descripe a create-function for the widget like: [code] $("#virtualgrid-demo").virtualgrid('create', { itemData: getItemData, numItemData: getNumItemData }); [/code] But the scroll-view remains empty, no data is put into it. Is there a working example of this widget? Cause the documentation dosen't seem to explain how to use this widget correctly :(
Stephan König
I've called the create-function in "pageinit", but it seems to work only in the "pageshow" event. And I have to set a width and height for the div. Now it seems to work...
Stephan König
I've got an additional questions for the virtual grid widget. I have to override the "ui-virtualgrid-wrapblock-x" class with an own "width" like "width: 105px !important;" to get all Data displayed in the widget. I think it would be helpfull if there was an complete example for this widget, cause like above you can see I got several problems to get this widget work... :/
Daehyeon Jung
Hi Sephan, See here: https://review.tizen.org/git/?p=framework/web/web-ui-fw.git;a=blob;f=demos/tizen-winsets/widgets/grid/virtualgrid-rotation.html;h=8029e103e0a2843f8c969c373199ad482cc8b09c;hb=HEAD afaik there is a sample application "TizenWinset" in the SDK. That'll be helpful for you.   Regards  
Stephan König
... I got it to work, but still have some problems. One thing is to set an element as active wont work properbly. If I set one element active during select like: $("#pickerAltitudeContent").bind('select', function(event, ui){ $("#pickerAltitudeContent").find(".current").removeClass("current"); $(event.target).parent().addClass('current'); } Then on the next call of the Grid the element is marked, but if you scroll now an the marked element leaves the screen, an other elemend get marked and so on. Also the centerTo function dont seems to work currectly :/