Ext


Go Back   Ext JS Forums > Ext JS Community Forums (2.0) > Ext 2.x: Help

Reply
 
Thread Tools
  #1  
Old 03-20-2007, 03:23 AM
boydapa3's Avatar
boydapa3 boydapa3 is offline
Ext User
 
Join Date: Mar 2007
Posts: 14
boydapa3 is on a distinguished road
Send a message via Yahoo to boydapa3 Send a message via Skype™ to boydapa3
Default Button in Grid's cell

is it possible to attach the Ext.Button in columnModel?
if possible can you show me example.. tnx!

i'm new here and this library is great! tnx!
Reply With Quote
  #2  
Old 03-20-2007, 03:27 AM
JeffHowden's Avatar
JeffHowden JeffHowden is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: Forest Grove, OR
Posts: 1,037
JeffHowden is on a distinguished road
Send a message via MSN to JeffHowden Send a message via Yahoo to JeffHowden
Default

Instead of putting a button in the grid, why not use a toolbar and act on the selected row(s)?
__________________
Jeff Howden
Ext JS - Support Team Volunteer
jeff@extjs.com

Any and all code samples that are authored by me and posted on the Ext forums or website are hereby released into the public domain and I release anyone or entity of liability by using said code samples unless explicitly stated otherwise.

Opinions are mine and not necessarily endorsed by Ext, LLC. Please do not contact me directly for assistance unless requested by me.
Reply With Quote
  #3  
Old 03-20-2007, 03:29 AM
Animal's Avatar
Animal Animal is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: East Midlands, UK
Posts: 24,303
Animal will become famous soon enough
Default

Use a custom renderer for that column. In the render function create a span with a generated id, and set off an onAvailable on that id to create the Button.
__________________
ExtJs forum volunteer. No official connection to the Ext Company. I do not speak for them.
ExtJs consultancy offered. £ 50/hour. Evenings+weekends. the_bagbournes@btinternet.com

Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
See Saki's samples: http://examples.extjs.eu/
Build your own Ext: http://extjs.com/products/extjs/build/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Reply With Quote
  #4  
Old 03-20-2007, 03:37 AM
boydapa3's Avatar
boydapa3 boydapa3 is offline
Ext User
 
Join Date: Mar 2007
Posts: 14
boydapa3 is on a distinguished road
Send a message via Yahoo to boydapa3 Send a message via Skype™ to boydapa3
Default

i've tried this one..
....
},{
  header: "Edit",
  width: 50,
  sortable: true,
  renderer: myButton = function(){return '<span id="edit"></span>';}
},{
...
....
btnEdit = new Ext.Button('edit',{text: 'edit'});
...
but it returns error "el has no properties"

[/code]
Reply With Quote
  #5  
Old 03-20-2007, 03:40 AM
Animal's Avatar
Animal Animal is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: East Midlands, UK
Posts: 24,303
Animal will become famous soon enough
Default

Well of course. That's why I said to set off an onAvailable wait.

There's no element with an id of "edit" until the renderer has been called to create the data cell....

And then there will be many - one in each row! Which is why I also said generate an id.
__________________
ExtJs forum volunteer. No official connection to the Ext Company. I do not speak for them.
ExtJs consultancy offered. £ 50/hour. Evenings+weekends. the_bagbournes@btinternet.com

Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
See Saki's samples: http://examples.extjs.eu/
Build your own Ext: http://extjs.com/products/extjs/build/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Reply With Quote
  #6  
Old 03-20-2007, 03:46 AM
boydapa3's Avatar
boydapa3 boydapa3 is offline
Ext User
 
Join Date: Mar 2007
Posts: 14
boydapa3 is on a distinguished road
Send a message via Yahoo to boydapa3 Send a message via Skype™ to boydapa3
Default

Actually, I'm new with this library, and I started a project using this one..

I have no idea how can i generate an ID and about the onAvailable event.

I'll be thankful if you can give me some example..

Thanks!!
Reply With Quote
  #7  
Old 03-20-2007, 03:48 AM
papasi's Avatar
papasi papasi is offline
Ext User
 
Join Date: Mar 2007
Posts: 127
papasi is on a distinguished road
Default

if you have a lot of rows and you want to create a button for each row it might not be practical to attach events to wait for each id onavailable.

another suggestion is to bind a custom css classname to that column and use domquery to select all the cells after the grid is rendered.
Reply With Quote
  #8  
Old 03-20-2007, 03:51 AM
JeffHowden's Avatar
JeffHowden JeffHowden is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: Forest Grove, OR
Posts: 1,037
JeffHowden is on a distinguished road
Send a message via MSN to JeffHowden Send a message via Yahoo to JeffHowden
Default

What is the purpose of these buttons?
__________________
Jeff Howden
Ext JS - Support Team Volunteer
jeff@extjs.com

Any and all code samples that are authored by me and posted on the Ext forums or website are hereby released into the public domain and I release anyone or entity of liability by using said code samples unless explicitly stated otherwise.

Opinions are mine and not necessarily endorsed by Ext, LLC. Please do not contact me directly for assistance unless requested by me.
Reply With Quote
  #9  
Old 03-20-2007, 03:51 AM
Animal's Avatar
Animal Animal is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: East Midlands, UK
Posts: 24,303
Animal will become famous soon enough
Default

The documentation is 80% there, and the bits you need are all there.

http://www.yui-ext.com/deploy/ext-1.0-alpha3/docs/

See the Ext base class, specifically Ext.id()

Docs about the YAHOO foundation classes are on the old docs page (Don't use this page for info about Ext), but hopefully they will be included in the official release os Ext 1.0:

http://www.yui-ext.com/deploy/yui-ext/docs/

You will need to find YAHOO.util.event.onAvailable()
__________________
ExtJs forum volunteer. No official connection to the Ext Company. I do not speak for them.
ExtJs consultancy offered. £ 50/hour. Evenings+weekends. the_bagbournes@btinternet.com

Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
See Saki's samples: http://examples.extjs.eu/
Build your own Ext: http://extjs.com/products/extjs/build/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Reply With Quote
  #10  
Old 03-20-2007, 04:01 AM
boydapa3's Avatar
boydapa3 boydapa3 is offline
Ext User
 
Join Date: Mar 2007
Posts: 14
boydapa3 is on a distinguished road
Send a message via Yahoo to boydapa3 Send a message via Skype™ to boydapa3
Default

When the button was click it will launch a dialog for editting of the contents
Reply With Quote
Reply

Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to activate a cell editor based on another cell? kimu Ext 2.x: Help 2 05-21-2008 03:01 PM
Display a button in a cell. dmayer Ext 1.x: Help 3 09-21-2007 12:04 AM
Click handler for grid's refresh button SLerman Ext 1.x: Help 2 02-22-2007 10:52 AM
dialog(s) called from button on cell(s) in grid mcrusty Ext 1.x: Help 1 01-26-2007 03:28 AM
Grid: append cell dom object before rendering cell ericwaldheim Ext: Feature Requests 7 12-01-2006 04:50 PM

All times are GMT -5. The time now is 12:28 PM.

© 2006-2009 Ext, LLC
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.