Home > add on development > Sorting a table in the front-end

Sorting a table in the front-end

February 26Hits:1
Advertisement

I'm using the Table class to render a table in my module and I want the user to be able to sort by clicking on column headers. I'm following the docs here, but when I use set_columns and set_data I get an error from libraries/EE_Table.php stating that EE::$cp is not defined.

Is it not possible to do sortable tables in the front-end? From the error, I guess it is only possible in the control panel.

Answers

EE uses the codeigniter table library .. http://ellislab.com/expressionengine/user-guide/development/cp_styles/index.html#table-based-layout

The issue you're probably running into is that it's trying to use one of the default CP styles. The library itself should be usable without being in the control panel, though jquery tablesorter may still be a better choice.

Related Articles

  • Sorting a table in the front-endFebruary 26

    I'm using the Table class to render a table in my module and I want the user to be able to sort by clicking on column headers. I'm following the docs here, but when I use set_columns and set_data I get an error from libraries/EE_Table.php stating tha

  • Sorting the Table and getting the positionMay 23

    I am able to sort a table using the following code:SELECT * FROM Persons ORDER BY LastName But I wanted to get the ranking/position of a person using that order. For example when I sort Person table by age, I want to get the rank/position of a person

  • When sorting WP_List_Table, table sorts, but I also get SQL errorsAugust 13

    Here's my lovely prepare_items() function: function prepare_items() { global $wpdb; $table_name = $wpdb->prefix . 'blah'; $per_page = 100; $columns = $this->get_columns(); $hidden = array(); $sortable = $this->get_sortable_columns(); $this->_c

  • Can't find the toolbar for sorting the table of contents in alphabetical order in Arcmap!April 18

    I am using ArcGIS Desctop 10.0 Service Pack3 and I'd like to sort the table of contents in alphabetical order but following Sorting the table of contents in alphabetical order I can't find the "Production TOC Manager" toolbar. Am I missing anyth

  • Is it possible to sort a Table of Contents alphabeticallyApril 30

    I would like to sort the Table of Contents of a document alphabetically rather than by page number. Suppose I have a Table of Contents automatically generated from headings like this one : TABLE OF CONTENT Updating your ToC...........................

  • How to sort a table in a polygon shapefile in order of an intersecting line?December 5

    I have 119 parcels that intersect a polyline. I want to be able to sort the table to see if any of the land owners in the parcels have have consecutive ownership along the line. Is there a way to do this? Or some other process to see the order? -----

  • How to sort a table in Pages?January 15

    Few hours ago I am trying to sort a table! I don't know where is this think but is so annoying that I can't find with ease this thing. I saw many articles saying that you have to go to Inspector, table tab and there is an option there, but this is th

  • How to sort attribute table using ArcObjects/VBA code?August 10

    I'm using ArcMap 9.3. Shift the rows order display (ascending/descending) for a given field is as simple as double clicking on the screen. However I'd like to know how to perform this simple operation through automation, in my case, using VBA code. I

  • Updating numerical column with autonumbers in sorted query table in ArcGIS for Desktop?

    Updating numerical column with autonumbers in sorted query table in ArcGIS for Desktop?November 11

    I am trying to find a suitable code that lets me to update a numerical column (namely, "RevOdrNo") of a sorted query table (not a separate table) with autonumbers (e.g. 1,2,3,4,5,6) in ArcGIS 10.3's Field Calculator without using the physical ID

  • How to sort a table in a pdf using itextsharp

    How to sort a table in a pdf using itextsharpFebruary 12

    I am creating a table in PDF by using iTextsharp. I want to sort that table by its columns. .When i click on first column it must be sort in alphabetical order,second column must sort in date wise order(Ascending order),and Third/fourth columns must

  • "0" values first or last in table when sorting/filtering table column

    "0" values first or last in table when sorting/filtering table columnJune 26

    There are tables in our app with a sortable position column which contains values between 0 to 50. Which, in our case, 0 means the item cannot be found. So the question is, when sorting the column ascending / low to high, should the 0 values be displ

  • Sorting dynamic table content with jQueryApril 4

    I've been trying to use numerous jQuery plugins for tabling sorting in WordPress and have had absolutely no luck. Can anyone make a suggestion for a plugin that sorts tables of dynamic content? I'm using the following code to generate the table: $arg

  • Why does my ORDER BY sort two tables before the EXCEPT (slow) and not after (fast)?

    Why does my ORDER BY sort two tables before the EXCEPT (slow) and not after (fast)?July 6

    SQL server 2008 R2 query optimizer puzzle We have two tables, both containing 9 million rows. 70.000 rows are different, the others are the same. This is fast, 13 seconds, select * from bigtable1 except select * from similar_bigtable2 This sorts the

  • Sorting a table according to values in another table

    Sorting a table according to values in another tableAugust 19

    I have two tables (A and B), both with a string valued column and an integer valued column. What i would like to actually have is a sorted table B sorted by the values of table A. The crucial point is that the rows are identified by the string value,

  • Is it possible sorting a table with non-database driven data?December 16

    I am creating tables, using data from services. This data is not stored in a db. But while I have been able to theme it using tableselect, I can't get sorting to work. Adding sort on fields, expects me to also integrate that to a query, for things to

  • Sort a Table View by Fivestar Rating FieldsJanuary 6

    I'm currently using Fivestar-7.x-2.0-alpha2 and Views-7.x-3.7. And running Drupal 7. I am trying to create a table view that displays the information from fields on a certain node type. In this case, the "Program" node and all of the rating fiel

  • Sorting a table of vectors with weights April 16

    This question already has an answer here: Combining values in one column (or part) when values in another column (or part) match 7 answers I'm trying to simplify a table, for instance {{1, {4, 2, 0}}, {4, {2, 4, 0}}, {-2, {3, 3, 0}}, {1, {3, 0, 3}},

  • Big switch statement for sorting a tableOctober 2

    I have a webpage with a table. The table, with 10 columns, can be sorted by each column ascending or descending. At this moment I control order by big switch: Func<IQueryable<DeviceUsage>, IOrderedQueryable<DeviceUsage>> orderBy; IOrdere

  • Sorting a table based on nullable Position field that has to match the position on the result setDecember 16

    I'm using SQL Server 2012 I have a simple table that has a Nullable (int) Position and a (datetime) Created field. I would like to do a select * from this table order by created desc but ...if a record has a Position value NOT NULL, we should insert

  • Is it possible to sort a table by entry modification date? Specifically, how to access from VBA the last modification time of an object?January 31

    I have a MS Word document where I accumulate and frequently modify certain data in a very long table. So I would like to sort the data by latest modification time in the rows. Of course if I add a column where I enter the modification time by hand th

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.567 s.