|
#1
|
|||
|
|||
|
A couple of users have asked about portal support. Writing portals in SmartGWT / SmartClient is fairly simple as the Layouts have animation, and dynamic add / remove built-in. Here's an example of a SmartClient Portal
http://www.smartclient.com/smartgwt/...animation.html API's for this will be added in the next release, and likely a nightly build over the next few weeks. Sanjiv |
|
#2
|
|||
|
|||
|
Thanks Snajiv, that's a great example. But I have a further question: how can I keep this nice portal behavior while adding custom drag'n'drop features? For example, I need three columns with different size, and when a portlet is dropped on a bigger/smaller column, it must resize itself, adapting its width and height. Is adding a new DropHandler, and rewriting all the logic, the only way?
Something like this: Code:
Thank you for your answer... |
|
#3
|
|||
|
|||
|
So long as you have not called setWidth() on the portlet with a fixed pixel value (which establishes that pixel value as one that SmartClient Layouts must respect), moving the portlet between different Layouts should result in auto-sizing behavior.
|
|
#4
|
|||
|
|||
|
Thanks for your answer... that would work, but in addition to resizing the portlets I need to change their contents, because a small portlet's content is different from a medium or a large one (a ListGrid put in a large portlet should show many fields, but when it is dropped on a smaller column it could hide most of the fields, or even be replaced with another widget). Any suggestion?
Thank you again... |
|
#5
|
|||
|
|||
|
Seem like you could add a method that notifies the portlet of the size of column it's being dropped into, allowing it to do whatever it wants, for example, hide fields if it contains a grid.
|
|
#6
|
|||
|
|||
|
It seems I finally got it. I added a resize/hiding fields/whatever method to my Portlet class' DragRepositionStopHandler. I hope this will prove to be the correct approach.
Another question: When I move an empty portlet everything is fast, but when I add a listgrid to it (with addItem) there's a lag as i drop it on a column. Is this related to http://forums.smartclient.com/showthread.php?t=833 ? Thank you again! |
|
#7
|
|||
|
|||
|
Yes, that would be the cause of any lag, however, if it's a non-trivial lag it may indicate extra work is going on (eg maybe there are two clear/draw cycles or similar). You should be able to see this in the Developer Console by enabling log categories like "draws", "clears", and "redraws".
|
|
#8
|
|||
|
|||
|
Quote:
Where can I find the SmartGWT version of this sample ? Thanks Regards KC |
|
#9
|
|||
|
|||
|
Has the GWT wrapper for the SmartClient portal component(s) been finished yet?
|
|
#10
|
|||
|
|||
|
Its on the TODO list but if you're in a hurry or would liek to lend a hand, you can try writing the SmartGWT equivalent of it yourself and post here if you run into any roadblocks. The code is fairy small.
View Source here : http://www.smartclient.com/smartgwt/...animation.html and the Portal code itself portalComponents.js Sanjiv |