Topic: Set attributes in all parts in new tables plugin

Hi,
I'm using tegh table plugin and I've modified it to allow attributes to be set for the TR elements, any chance of making this a SVN change and maybe also adding that to the other bits (it's justa replication of the code that you already have on the cells)?

>     if ('object' == typeof (value)) {
>         var property = value['property'];
>         var value = value['value'];
>         eval('objects.row.' + property + ' = value;');
>     } else
>         {
247a257
>         };

Steve

Re: Set attributes in all parts in new tables plugin

steveh,

Thank you for your feedback regarding the table plugin.

I believe the same functionality can be accomplished with the current version, given that xajax already supports assigning properties and events using (assign, append) and (addEvent, addHandler, removeHandler).  I suppose it is not possible to do so using [table name], [row number], however, it is possible to reference the rows by their ID value.

I am thinking that, if/when implemented, it would be good to implement this as a new function.  In fact, assignRow is probably the best name, where the current function named assignRow should be assignRowColumns (since that is what it in fact does).

I'd like to avoid hidden functionality (whereby a function operates differently based on whether you pass an array or a single value).

Additional thoughts, suggestions or perspectives?

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct

Re: Set attributes in all parts in new tables plugin

Don't mind either way, as soon as I looked at the code it seemed fairly logical in the way it was working so I just added the same code used elsewhere.

Guess it just needs to be consistant in the way it operates.

Re: Set attributes in all parts in new tables plugin

Hi,

you're talking about a "table plugin".

Where can I find this plugin?

Cheers
Fabs

Re: Set attributes in all parts in new tables plugin

When you download xajax 0.5 beta 2, there is a plugin folder containing this (beta) plugin.  Check it out and post your feedback here.  I'll be making refinements as time allows (perhaps including the one posted about above).

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct

Re: Set attributes in all parts in new tables plugin

I did a download and also found the table test in /suite, but it tries to call a file in xajax_plugins which is not included in the download.

As I use 0.2.4 at the moment also the question if there is a  version for this.

Fabs

Re: Set attributes in all parts in new tables plugin

Fabs,

Yes, it seems that the plugins did not get included in the xajax 0.5 beta 2 release.  Hopefully, they will be included in future releases.

steveh,

I finally got around to implementing setRowProperty($property, $value, $parent, $position); and setColumnProperty(...); per your suggestion.  I've had problems setting TR styles such as padding and borders... but I suspect this is a DOM limitation.  Sorry for the long wait on this change!

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct

Re: Set attributes in all parts in new tables plugin

Having a problem with appending a table row, it always goes at the bottom of a table regardless?

eg

row1
row2
row3

If I append a rowx after row1 I'd expect

row1
rowx
row2
row3

but I actually get

row1
row2
row3
rowx

Steve

Re: Set attributes in all parts in new tables plugin

I forgot to add that I checked this, then got the latest SVN and it was still the same.

Re: Set attributes in all parts in new tables plugin

Yes, this is expected (not necessarily desired) behavior.  The tables plugin supports Insert *before*, but not Insert *after*... when you have a chance, you can test that function using the tests/suite/index.php script... then select Tables from the drop down at the top left corner.

(I just verified that it is working using the latest from SVN)

Hope that helps a little.  I'll look into adding support for that.

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct

Re: Set attributes in all parts in new tables plugin

No problem there, when I insert a new set of rows I now insert 1,2 and 4, with 4 being an empt6y row so I can then go back and insert my others before it if needed (you'd need to see the app for that to make sense - but it does!!)

When you document it add the factthat the first row in the table determines the number of columns (might be worth making that a parameter to the insert, or letting it consume the number of columns in the array?)

Another question, if I add a row then add columns, how can I name those columns so I can set thyeir properties at a later point?

Steve

Re: Set attributes in all parts in new tables plugin

You can assign properties and values to cells by referencing their rowID and column number, if you wish.  You can also (I believe, not tested) reference a cell by the tableID, row number, cell number.

When I have time, I'll check on this.

Does that help?

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct

Re: Set attributes in all parts in new tables plugin

That'll do me!

14 (edited by steveh 2007-03-02 9:51:40 PM)

Re: Set attributes in all parts in new tables plugin

I need to add a row with no cells, is there a quick way to do that (this is because as above I need to add some dynamic data at the end of a section of rows which are themselves repeated).

Failing that, can I clear the cells from a row?

I think it might wbe worth having the number of cells a parameter as you may have a 4 cell table but only want to add 2 cells to your new row as you;re going to colspan them?

Re: Set attributes in all parts in new tables plugin

I'm glad the tables plugin is finally getting a workout! smile

I'll add this to the TODO list, sounds like a good idea (specifying the number of cells for a new row or column)

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct