Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sergio Cabrera
Liferay Auto Fields sortable
February 7, 2012 11:29 AM
Answer

Sergio Cabrera

Rank: Junior Member

Posts: 68

Join Date: December 19, 2011

Recent Posts

Hello, I'm using "liferay-auto-fields" in my own portlet and I'd like to make them sortable. I've seen in the source code an option to get that:

 1        /**
 2         * OPTIONS
 3         *
 4         * Required
 5         * container {string|object}: A selector that contains the rows you wish to duplicate.
 6         * baseRows {string|object}: A selector that defines which fields are duplicated.
 7         *
 8         * Optional
 9         * fieldIndexes {string}: The name of the POST parameter that will contain a list of the order for the fields.
10         * sortable{boolean}: Whether or not the rows should be sortable
11         * sortableHandle{string}: A selector that defines a handle for the sortables
12         *
13         */


As far as I can see I need to implement a sortableHandle, but I don't know how or where. Can anyone guide me a bit?

Thanks
Andrey Filippov
RE: Liferay Auto Fields sortable
February 14, 2012 8:55 AM
Answer

Andrey Filippov

Rank: New Member

Posts: 23

Join Date: October 21, 2010

Recent Posts

Hey Sergio,
Use it something like this:

1var autoFields = new Liferay.AutoFields(
2                        {
3                            contentBox: '#<portlet:namespace />quests > fieldset',
4                            fieldIndexes: '<portlet:namespace />choicesIndexes',
5                            sortable: true,
6                            sortableHandle: '.row-fields'
7                        }
8                    ).render();
Sergio Cabrera
RE: Liferay Auto Fields sortable
February 14, 2012 1:24 PM
Answer

Sergio Cabrera

Rank: Junior Member

Posts: 68

Join Date: December 19, 2011

Recent Posts

That includes de <div> tag, but nothing happens. Should it be draggable or something like that?
Andrey Filippov
RE: Liferay Auto Fields sortable
February 15, 2012 12:39 AM
Answer

Andrey Filippov

Rank: New Member

Posts: 23

Join Date: October 21, 2010

Recent Posts

Yes, in my case a "drag" sign appeared in each <div class="row-fields"> rectangle and I could move them up and down. Btw - I am using 6.1 CE...
Sergio Cabrera
RE: Liferay Auto Fields sortable
February 15, 2012 2:00 AM
Answer

Sergio Cabrera

Rank: Junior Member

Posts: 68

Join Date: December 19, 2011

Recent Posts

I'm using 6.0.6. I'll check it again. Thanks
Sergio Cabrera
RE: Liferay Auto Fields sortable
August 4, 2012 1:47 AM
Answer

Sergio Cabrera

Rank: Junior Member

Posts: 68

Join Date: December 19, 2011

Recent Posts

Yes, it seems that there are several bugs in the 6.0.x ckeditor files. I updated ckeditor.jsp to the last version in 6.0.x liferay svn branch and it worked.