Hide Columns in DataTable

346 views
Skip to first unread message

jj Jarin

unread,
Aug 20, 2013, 10:20:14 PM8/20/13
to all...@googlegroups.com
 Good Day

I'm starting to lear liferay and would like to use alloy ui to it

I would just like to ask if there is a support for hiding and unhiding columns in Datatable?

Also I would like to ask why does this code works in viewing datatable

AUI().use(
                      'aui-datatable',
                      function(A) {
                        var columns = ['adsId', 'companyId', 'createDate', 'data1', 'data2', 'data3', 'data4', 'data5', 'groupId', 'modifiedDate', 'userId', 'userName'];
                        new A.DataTable.Base(
                          {
                              columnset: columns,
                              recordset: obj,
                              sortable : true
                          }
                        ).render('#myDataTable2');
                      }
                    );
           
            });

and if I use new A.DataTable() its giving me A.DataTable is not a constructor?

Thanks
jeff

Marc Lundgren

unread,
Aug 21, 2013, 6:56:38 PM8/21/13
to jj Jarin, all...@googlegroups.com
Hello Jeff,

I do not believe there is support for column hiding at this time. I tested column removing a column, but I do not recommended using this method of trying to hide columns.


--
You received this message because you are subscribed to the Google Groups "AlloyUI" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alloyui+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Marc Lundgren

Software Engineer

Liferay, Inc.

---

24-25 October 2012 | Liferay Spain Symposium | liferay.com/spain2012

16 November 2012 | Liferay Italy Symposium | liferay.com/italy2012

Arunachalam Renganathan

unread,
Feb 10, 2014, 8:58:03 AM2/10/14
to all...@googlegroups.com, jj Jarin

Hi Marc,

 I too getting same error. Im trying for editable grid in AUI.

  Please help me out.

Thanks 
Arun

Marc Lundgren

unread,
Feb 10, 2014, 12:39:03 PM2/10/14
to Arunachalam Renganathan, all...@googlegroups.com, jj Jarin
There are a couple cases of successful datatable column-hiding that I found on google


give those a shot. Honestly, your easiest task would be to just write your own css and hidden toggler function.


and if I use new A.DataTable() its giving me A.DataTable is not a constructor?

it will return a built class based on A.DataTable.prototype

Arunachalam Renganathan

unread,
Feb 11, 2014, 1:21:26 AM2/11/14
to Marc Lundgren, all...@googlegroups.com, jj Jarin
Thanks for the reply Marc..

My actual requirement is not hiding the column. 

I want to create a editable grid in Alloy UI. In Alloy UI examples, YUI().use () is used but in liferay we need to use AUI().use inside the <aui:script> tag. 

If we are using AUI, we are getting A.DataTable is not a constructor?

Please help me to resolve.

Marc Lundgren

unread,
Feb 11, 2014, 4:32:39 PM2/11/14
to Arunachalam Renganathan, all...@googlegroups.com, jj Jarin
YUI and AUI are the same object.

JSON.stringify(YUI) === JSON.stringify(AUI)  // true


A.DataTable is a Base Object. You can use Y (or A)'s extend method to extend DataTable.

something like 

A.extend(MyEditableDateTable, A.DataTable);
Reply all
Reply to author
Forward
0 new messages