Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Custom widget grid panel problem.

Avatar

Avatar
Validate 10
Level 2
Rui_J
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
Rui_J
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Rui_J
Level 2

15-10-2015

Hi,

  I am trying to write a custom that contains a gridpanel. This gridpanel loads some static data. And this is the code I have.When I load it, nothing shows up.[img]2014-08-11_9-32-42.png[/img]

  Can anyone tell me what the problem is?

Thank you.

Ejst.ContactSearch = CQ.Ext .extend( CQ.form.CompositeField, { /** * xtype: hidden store real value file: this is json format * {url: '/content/sample', text: 'sample'} */ valueField : null , userPanel: null , constructor : function(config) { config = config || {}; var defaults = { border : true, layout : "form", autoWidth : false }; config = CQ.Util.applyDefaults(config, defaults); Ejst.ContactSearch.superclass.constructor.call( this, config); } /** * create composite fields */ , initComponent : function() { Ejst.ContactSearch.superclass.initComponent.call(this);
// create children items this.valueField = new CQ.Ext.form.Hidden({ name : this.name }); var myData = [ ['user1','user1@gmail.com','office1','state1'], ['user2','user2@gmail.com','office2','state2'] ]; //The Data model that is used to populate the grid. It uses myData as the data source var store = new CQ.Ext.data.Store({ proxy: new CQ.Ext.data.MemoryProxy(myData), reader: new CQ.Ext.data.ArrayReader({}, [ {name: 'name'}, {name: 'email'}, {name: 'office'}, {name: 'state'} ]) }); this.userPanel = new CQ.Ext.grid.GridPanel({ store: store, colModel: new CQ.Ext.grid.ColumnModel({ defaults: { width: 120, sortable: true }, columns: [ {id: 'name', header: 'Name', width: 200, sortable: true, dataIndex: 'name'}, {header: 'Email', sortable: true, dataIndex: 'email'}, {header: 'Office', sortable: true, dataIndex: 'office'}, {header: 'State', sortable: true, dataIndex: 'state'} ] }), viewConfig: { forceFit: true, }, sm: new CQ.Ext.grid.RowSelectionModel({singleSelect:true}), width: 600, height: 300, frame: true, title: 'User information', iconCls: 'icon-grid' }); this.add(this.userPanel); } }); CQ.Ext.reg("contactSearch", Ejst.ContactSearch);

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 3
Employee
kaushal_mall
Employee

Likes

15 likes

Total Posts

39 posts

Correct Reply

12 solutions
Top badges earned
Give Back 3
Give Back
Boost 5
Boost 3
Boost 10
View profile

Avatar
Give Back 3
Employee
kaushal_mall
Employee

Likes

15 likes

Total Posts

39 posts

Correct Reply

12 solutions
Top badges earned
Give Back 3
Give Back
Boost 5
Boost 3
Boost 10
View profile
kaushal_mall
Employee

15-10-2015

Can you try changing your myData variable and add the key names? Something like 

name:user1, email:user1@user1.com, office:office1, state:state1.

Answers (0)