PDA

View Full Version : Grid grid lines - iterate records



gregsimons
13 Jun 2007, 11:58 PM
Is there any way to set show vertical or horizontal lines on the grids?

Also I need to be able to copy text to the clipboard. I am looking to iterate through the selected entries and get the text out - I can do this but I get all the HTML as well. Is there anyway to just get the actual text out...

Thanks
Greg.

Animal
14 Jun 2007, 12:27 AM
Is there a clipboard API in javascript? Can you point us at the docs?

gregsimons
14 Jun 2007, 10:55 PM
Ive put in a separate datamodel class now which i build up when i render the original html table before converting it. I then use the indexes from the selection model to get the actual text out of the datamodel which doesnt have any of the images etc in. I then put this in a dialog which the user can copy and paste out of in to excel or the like. I could have used IE specific commands but Firefox requires changes in about:config so I decided to use the dialog instead.

Any ideas on hiding and showing the Grid Lines?

Animal
14 Jun 2007, 11:46 PM
Grid lines are controlled by the x-grid-col class.

So



Ext.util.CSS.createStyleSheet("#myGridContainerId .x-grid-col {border:0px none}");


Should get rid of your lines because it has a higher precedence rule than Ext's basic rule.

To show them, you should be able to



Ext.util.CSS.updateRule(""#myGridContainerId .x-grid-col", "border", "");


I think.

I'm not sure about that CSS class. I think it should not be a singleton, but actually offer a constructor which creates a Stylesheet object which can then be manipulated by instance methods like updateRule, addRule which is lacking right now etc.... But I'm sure Jack had a design rationale behind the class.

It's the lack of addRule which I think is the main problem. This forces you to create a whole new Stylesheet to create dynamic rules to affect one instance of the grid.