|
2013-12-10
, 23:25
|
|
Posts: 1,055 |
Thanked: 4,107 times |
Joined on Oct 2009
@ Norway
|
#2
|
I add or remove a favourite (right now via LocalStorage SQL, which on first glance does not seem to be that persistent, at least for SDK deployments – alternatives are always welcome, if you'd like to share).
The Following User Says Thank You to w00t For This Useful Post: | ||
|
2013-12-10
, 23:38
|
Posts: 4 |
Thanked: 45 times |
Joined on Dec 2013
|
#3
|
I really would like those favourite Items to be available in the "Pulley" PullDownMenu, but I have not figured out how to feed a Model (which is pretty easy to manipulate from JS, perfect for me) there – funny, because for SilicaListView it just did what I wanted instantly without me needing a clue about… anything, to be honest.
Have I missed something really obvious? It surely seems like it.
PullDownMenu { Repeater { model: 4 MenuItem { text: "Item #" + model.index } } }
Also, what should be the expected outcome of a long press on a List Item in your opinion? Should there be a sub section popping out containing more options? Should I push a whole new Page to the Stack?
I feel that functionally a ContextMenu could suffice, but it's rather limited in displaying information like that appropriately, because it would have to tell the user the name, current state (enabled/disabled) and that you can actually toggle it. (Am I wrong? Please correct me!)
|
2013-12-10
, 23:47
|
|
Moderator |
Posts: 2,622 |
Thanked: 5,447 times |
Joined on Jan 2010
|
#4
|
|
2013-12-11
, 10:00
|
|
Posts: 394 |
Thanked: 1,341 times |
Joined on Dec 2009
|
#5
|
Maybe the current state should be part of the delegate itself, maybe by using the secondary text color?
The Following User Says Thank You to velox For This Useful Post: | ||
Tags |
javascript, jolla, pulldownmenu, silica |
|
Since my previous Phone died a few weeks ago (back to N900 for me) and the next one is apparently somewhere in a Warehouse in Finland*, I thought I'd put my insomnia to good use and take the Sailfish SDK for a spin. I do quite a bit of Javascript stuff, so I try to code most of it to included JS files.
After half a night of poking here and there, I've got some rudimentary excuse for a NinjaBlocks app running (it controls 433Mhz actuators and the Block's rgb/rgb8 LEDs), but I could not figure out how to append Items to a PullDownMenu dynamically from Javascript.
When I "onPressAndHold" an Actuator's SilicaListView Item (which, in real life, might correspond to a wall socket command, like 'switch on living room light 1'), I add or remove a favourite (right now via LocalStorage SQL, which on first glance does not seem to be that persistent, at least for SDK deployments – alternatives are always welcome, if you'd like to share).
I really would like those favourite Items to be available in the "Pulley" PullDownMenu, but I have not figured out how to feed a Model (which is pretty easy to manipulate from JS, perfect for me) there – funny, because for SilicaListView it just did what I wanted instantly without me needing a clue about… anything, to be honest.
Have I missed something really obvious? It surely seems like it.
Also, what should be the expected outcome of a long press on a List Item in your opinion? Should there be a sub section popping out containing more options? Should I push a whole new Page to the Stack?
I feel that functionally a ContextMenu could suffice, but it's rather limited in displaying information like that appropriately, because it would have to tell the user the name, current state (enabled/disabled) and that you can actually toggle it. (Am I wrong? Please correct me!)
A normal click on those Items triggers the action directly, and I wouldn't want to complicate this primary function. That's why I immediately went for long click. If this is against best practices – well, I'm about a day into this whole topic and ready for suggestions.
Thanks
*) Fingers crossed.