Ticket #756 (closed enhancement: fixed)

Opened 5 months ago

Last modified 3 months ago

QSimpleTable - a new table control

Reported by: vakopian Owned by:
Priority: important Milestone: 2.1
Component: QControls Version: 2.0.2 Stable
Keywords: Cc:

Description

Attached is new control class I created called QSimpleTable.
The idea is to have a simple control that can return or display tabular data, without the need to handle the complex features of QDataGrid (sorting, filtering, row actions, etc).

Even more importantly, this implementation does not use eval() to compute cell values. Instead it uses user specified functions, or (PHP 5.3) Closures.

Calculating the cell values is thus greatly simplified, which will allow to easily return the tabular data in other formats (e.g. json, xml, etc).

As you may have guessed, my goal is to use this class as a base class for wrapping jqGrid or DataTables? jQuery plugins. To do that with QDataGrid would have been cumbersome and most likely inefficient.

Of course it comes with a full example which will give you guys a better idea on how to use it.

I would really like to include this in the upcoming 2.1 version.

Attachments

ticket756.patch Download (27.8 KB) - added by vakopian 5 months ago.
replaced badly formated patch
ticket756-v2.patch Download (21.7 KB) - added by vakopian 5 months ago.
a simpler and more efficient version (as a patch over the first version)

Change History

Changed 5 months ago by vakopian

replaced badly formated patch

Changed 5 months ago by alex94040

  • status changed from new to in_QA
  • milestone set to 2.1

Changed 5 months ago by alex94040

This is AMAZING. Reviewing this now.

Changed 5 months ago by alex94040

  • status changed from in_QA to closed
  • resolution set to fixed

(In [1361]) Fixes #756 (QSimpleTable - a new table control). Code by vakopian. Review and slight formatting changes by alex94040.

Changed 5 months ago by vakopian

  • status changed from closed to new
  • resolution fixed deleted

Wow, Alex, I did not get a chance to submit my version 2 :-)
Anyway, here is version 2, even more simple and more efficient.
I basically split the QSimpleTableColumn into 3 different subclasses (and an abstract base), so that each of them is much simpler and FetchCellValue() is even more efficient since it doesn't need to do type checking at all. This gets rid of the "Accessor" terminology and its overloads. I also removed the unnecessary Translate property. Also, added 3 helper methods to QSimpleTable to simplify column creation. The example is updated accordingly.

I'll make it into a patch on top of what you already committed if you prefer.

Changed 5 months ago by vakopian

a simpler and more efficient version (as a patch over the first version)

Changed 5 months ago by alex94040

I love it!!! Awesome!!

Changed 5 months ago by alex94040

  • status changed from new to in_QA

Changed 5 months ago by alex94040

Feel free to check in, that is :)

Changed 5 months ago by vakopian

  • status changed from in_QA to closed
  • resolution set to fixed

(In [1369]) reviewed by alex. Fixes #756

Changed 3 months ago by vakopian

(In [1404]) fix typo in closing td and th tags. Refs #756

Changed 3 months ago by vakopian

(In [1405]) Add OrderByClause? and ReverseOrderByClause? properties. Refs #756

Changed 3 months ago by vakopian

(In [1406]) include order by clauses in serialization. Fixes #756

Note: See TracTickets for help on using tickets.