Re: Adding Jx.Panel at runtime and binding jx.grid to it

116 views
Skip to first unread message

Jon Bomgardner

unread,
Aug 30, 2012, 2:24:03 PM8/30/12
to jx...@googlegroups.com
It will be a lot easier to figure out what's going on here if you can provide a complete example online somewhere. At the very least, format the code you post so that it's readable.
 
Jon

On Wednesday, August 29, 2012 8:17:00 AM UTC-7, Json wrote:
Hello, I am exploring jx.lib to create an instance of editable jx.grid at runtime, though i am able to achieve this but unsuccessfull to add it to panel and too to right side of splitter. Currently i am adding this grid to task pane which is not a good idea. You may refer current and expected attached files for your reference. 'Current' is what i am getting now and 'expected' is what i want in diff. i.e. slate layout. Also, i am unable to start editing on cell , kindly help me on this on too. Please refer the code which i am using to create grid with editing

 
//create grid grid = new Jx.Grid(store, { parent: 'gridEventEnabled', row: { useHeaders: true, alternateRowColors: true, headerField: '', rowHeight: 'auto' }, columns: { headerRowHeight: 20, useHeaders: true, columns: [jxcolumns] }, model: store });
 grid.addEvent('gridRowClick' , rowHeader); store.addEvent( 'storeDataLoaded', function () { prelighter.activate('cell'); prelighter.attach(grid); selector.attach(grid); sorter.attach(grid); editor.attach(grid); grid.render();  store.load();

i have sucessfully created gird in above lines .. i have copied only section of code in above steps
CODE TO ADD ABOVE GRID TO PANEL AT RUNTIME BUT NOT WORKING!!!

var p2=new Jx.Panel({label: 'Attribute Editor', content: grid.domObj, height: 200});
var sm = new Jx.PanelSet(mapWidget.getDomObj('MapArea'), [p2]);
sm.maximizePanel(p2);
mapWidget.resize();

Regards

Json

unread,
Sep 6, 2012, 12:08:00 PM9/6/12
to jx...@googlegroups.com
please reply on this
 
regards
saurabh

On Monday, September 3, 2012 9:36:33 PM UTC+5:30, Json wrote:
Hello Jon,
 
Thanks for replying , i am really looking forward for your help, i have already replied on your post 2 days back but its weird my comments are not visible :(((
This is what i am doing to add jx.grid to jx.panel at runtime but its not happening or i say its acting weird
 
here i am succesfully able to create jx.grid object which i am using in below lines....
 
var p2=new Jx.Panel({label: 'Attribute Editor', content: grid.domObj, height: 200});
var sm = new Jx.PanelSet(mapWidget.getDomObj('MapArea'), [p2]);
 sm.maximizePanel(p2);
mapWidget.resize();
 
please let me know if you still unclear on this..
 
NOTE:: i am GIS developer and using Autodesk infrastructure map server for my customization , so mapwidget here actually in simple words is the object which contains my map.
 
Regards

Jon Bomgardner

unread,
Sep 6, 2012, 4:47:38 PM9/6/12
to jx...@googlegroups.com
I'm sorry that I haven't had time to look at this but honestly, from this small piece of code it's impossible to see what might be wrong. If you can attach the code file where you're doing this or post it online somewhere it would be much easier to do. The order you create things and attach them to other objects is important and impossible to really tell from these few lines.  If I had to guess (which I do at this point), I would suggest redrawing the grid after you add it to the panel.  After you resize the mapwidget you can try calling grid.resize() or even grid.render() if that doesn't work.

Again, a more complete example - even a pared down one that illustrates the issue - would be a lot more useful.

Jon

Json

unread,
Sep 13, 2012, 5:04:46 AM9/13/12
to jx...@googlegroups.com
Hi Jon,
 
I am attaching code file for your reference, please have a look what you make out of it. In a same file i am having code for editing and adding grid to panel at runtime
 
 
Regards
 
Saurabh
AttributeEditor.aspx.cs
AttributeEditor.aspx
Reply all
Reply to author
Forward
0 new messages