Read current crx path of multi field item, transfer it to a servlet, and load response from servlet into JsonStore to display in GridPanel
Hey guys
The title sums it up pretty well. I'm extending GridPanel and in that custom GridPanel I want to do the following:
- I want to retrieve the CRX path of the current (custom) multi field item, for example like this: findParentByType("CQ.Dialog").path
- Transfer that path as parameter to my servlet: /myservlet?path=currentCrxPath
- Take the JSON response from the servlet, load into a JsonStore and display it in the GridPanel
Until now i have the following code:
/** * custom grid view * @type {CQ.Ext.grid.GridPanel} */ Namics.form.ExternalFormReferences = CQ.Ext.extend(CQ.Ext.grid.GridPanel, { store: new CQ.Ext.data.JsonStore({ data: { references: [ {path: '/path/to/entry1', title: 'Entry 1'}, {path: '/path/to/entry2', title: 'Entry 2'} ] }, root: 'references', fields: ['path', 'title'] }), columns: [ { header: 'Path', width: .5, dataIndex: 'path' }, { header: 'Title', width: .35, dataIndex: 'title' } ], viewConfig: { forceFit: true }, sm: new CQ.Ext.grid.RowSelectionModel({singleSelect:true}), width:600, height:300, frame:true, iconCls:'icon-grid', constructor : function(config) { Namics.form.ExternalFormReferences.superclass.constructor.call(this, config); findParentByType("CQ.Dialog"); //return null (too early?) }, }); CQ.Ext.reg("externalformreferences", Namics.form.ExternalFormReferences);I'm struggling in finding a good moment (be it listener or constructor) to fetch the current crx path, do the servlet call and later update the GridPanel. Do you have any tips for me? I'm currently working with static Json data until I have found a good listener/method to obtain the current crx path.