Data listing and filtering class with support of autoloading on scroll event, Excel output, Ajax cell update, column chooser, tabs filter.
Version 1.5 (4.5)
Formerly known as ‘phpList’ (c)2005-2025 Eliseev Ilya https://russysdev.github.io/eiseIntra/
Authors: Ilya Eliseev, Pencho Belneiski, Dmitry Zakharov, Igor Zhuravlev License: MIT
sponsored: Yusen Logistics Rus LLC
Configuration array with default settings. You can override them in constructor.
public $conf = Array(
'includePath' => '../'
, 'dateFormat' => "d.m.Y" //
, 'timeFormat' => "H:i" //
, 'decimalPlaces' => "2"
, 'decimalSeparator' => "."
, 'thousandsSeparator' => ","
, 'titleTotals' => 'Totals'
, 'titlePleaseWait' => 'Please wait...'
, 'titleNothingFound' => 'Nothing found'
, 'titleERRORBadResponse' => 'ERROR: bad response'
, 'titleTryReload' => 'try to reload this page'
, 'titleFilterDateFrom' => 'Period Start'
, 'titleFilterDateTill' => 'Period End'
, 'titleFilterApply' => 'Apply'
, 'titleFilterClear' => 'Clear'
, 'titleFilterClose' => 'Close'
, 'titleTabAny' => 'Any %s'
, 'controlBarButtons' => 'btnSearch|btnFieldChooser|btnOpenInExcel|btnReset'
, 'exactMatch' => false
, 'dataSource' => "" //$_SERVER["PHP_SELF"]
, 'rowsFirstPage' => 100
, 'rowsPerPage' => 100
, 'maxRowsForSelection' => 5000
, 'calcFoundRows' => true
, 'cacheSQL' => true
, 'doNotSubmitForm' => true
, 'isNullFilterValue' => 'n/a'
, 'cookieExpire' => 0
, 'hiddenColsExcel' => array() // array of columns to be hidden on Excel output
, 'flagNoExcel' => false
, 'debug' => false
, 'tabsFilterColumn' => null // if set, list will try to breakdown data into tabs with titles from column source
);
Category: List Configuration
Default column settings
private static $col_default = Array(
'title' => ''
, 'type' => 'text' // text, integer, date, datetime, select, combobox, ajax_dropdown, checkbox, row_id, order
, 'PK' => false // if true, column is a primary key, it will be used to update data
, 'phpLNums' => null // if true, column will be rendered as row number, it will be used to update data
, 'sql' => null // SQL expression, if empty, field is used
, 'source' => null // source for select, combobox, ajax_dropdown
, 'source_prefix' => null // source for select, combobox, ajax_dropdown, if empty, field is used
, 'order_field' => null // field name to order by, if empty, field is used
, 'filter' => null
, 'filterValue' => null // value to filter by, if empty, no filter is applied
, 'exactMatch' => false // if true, filter will be exact match, otherwise LIKE '%filterValue%'
, 'group' => null // field name to group by, if empty, no grouping is applied
, 'aggregate' => null // aggregate function to apply, if empty, no aggregate is applied
, 'flagNoExcel' => false // if true, column will not be shown in Excel output
, 'checkbox' => false // if true, column will be rendered as checkbox
, 'class' => '' // CSS class to apply to the column
, 'width' => '' // CSS width to apply to the column
, 'href' => null // if set, column will be rendered as link with this href
, 'nourlencode' => false // if true, href will not be urlencoded
, 'limitOutput' => 0 // if set, column will be limited to this number of characters
);
Category: List Configuration
Class constructor. Intra object can be passed as part of $arrConfig array with ‘intra’ key to inherit some settings from eiseIntra.
Parameters:
Category: List Configuration
This method adds columns to $Columns property.
Parameters:
Category: List Configuration
This method changes column property to defined values and returns its previous value.
Parameters:
Returns: variant - previous property value. If property ot column is not found , it returns NULL
Category: List Configuration
This method filters columns according to supplied array and put it in specified order
Parameters:
Category: List Configuration
This function returns column array and updates the key it could be accessed from $lst->Columns list
Parameters:
Category: List Configuration
This function removes column by field name.
Parameters:
Category: List Configuration
This function handles data requests and returns them in requested format: JSON, Aggregate data JSON or Excel XML.
It caches SQL query and columns configuration for faster response on next requests.
Category: List Data Handling
This function directly outputs list contents in HTML.
Category: List Display
This function updates a particular field in eiseList with DataAction=updateCell. If there’s no $intra and user isn’t granted to update or write on the script below, it doesn’t work. Otherwise it updates a field in the table specified in sqlFrom basing on primary key value. AFter update it generates json with intra and dies.
In currenct version it works only with string and int values. NULL cannot be transferred.
Parameters:
Category: List Data Handling
This function returns cookie array.
Returns: array of cookie data for given list. If there’re no cookie set, it returns null.
This function obtains filter value for $field parameter from $_GET.
Parameters:
Returns: string - filter value. If filter’s not set, it returns NULL.
Category: List Data Handling
This method handles eiseList input: $_GET, $_COOKIE and session parameters. What can be set to the list via input:
The list gets search parameters from cookie or session, but if there’s something set with $_GET, this data overrides cookie settings. What parameters can be set with $_GET:
<list name>HiddenCols - comma-separated list of hidden columns<list name>MaxRows - maximum row number to obtain during the query<list name>OB - field name to order by<list name>ASC_DESC - direction field, can be ‘ASC’ or ‘DESC’<list name>_<field name> - filter value(s).Parameters that saved with cookies are stored as serialized array under key $this->conf['cookieName'].
Cookie array member keys are:
<filter values> - are stored under keys consists of $this->name.'_'.$col['filter'] .Filter values for columns with 'filterType'=>'multiline' are stored into $_SESSION variable as array member under $this->conf['cookieName'] key.
Hidden columns array, maximum row number, sort ordering parameters are being set to the corresponding list variables. Filter values are assigned to $this->Columns array members as ‘filterValue’ array member. Afterwards it sets cookie with specified parameters and saves correspoding data into the session.
Category: List Data Handling
This function composes SQL query for the list basing on list columns, filters, sorting and grouping settings.
Category: List Data Handling
This method returns SQL search expression for given column as string that looks like myColumn='my filter value'.
In common case: <searchSubject> <searchOperator> <searchCriteria>
<searchSubject> is column name or SQL expression that would be tested on match with supplied filter value.
<searchOperator> and <searchCriteria> are defined basing on column type, filter value and other factors.
For text, it searches for partial match by default (expression is myColumn LIKE '%my filter value%')
In case when column has ‘exactMatch’ property set to TRUE or filter value is encolsed into double or single quotes (“’” or “””), it returns expression for direct match: myColumn='my filter value'
For numeric values it allows to use comparison operators, like =, ,, <, >= or <= before the number in filter value.
Same is for date/datetime values. For these types it also allows logical “&” (“and”) operator.
If filter value is empty, it returns empty string (only if exact match option is not set for this column).
If filter value matches matches isNullFilterValue from configuration we return <searchExpression> IS NULL.
Parameters:
Returns: string
Category: List Data Handling
phpLister class extends eiseList class to provide backward compatibility with phpLister library. It has the same constructor as phpLister class had and an Execute method that sets main SQL parameters.
Category: List Backward Compatibility
requires jQuery UI 1.8: http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js
Published under GPL version 2 license (c)2005-2025 Ilya S. Eliseev ie@e-ise.com, easyise@gmail.com
Contributors:
eiseList reference http://russysdev.github.io/eiseIntra/gridlist
This function initializes eiseList plugin on specified element. This element is formed with eiseList PHP class. It craetes eiseList object and associates it with the element.
Parameters:
Category: List Configuration
Returns:
Refreshes the eiseList contents according to existing filters and sort order.
Category: List Data Handling
Returns:
eiseList('getListObject') returns eiseList object associated with the element.
Category: List Configuration
Returns: eiseList object
This method returns array or string of selected row IDs - in other words, rows marked with checkboxes in fields that match the selectorinput[name='sel_"+list.id+"[]'].
Returns: array of row IDs