Define the name of form: Función:Form ('formName',doForm);Parámetros:
formName : Name of the form
doForm :
Ejemplo de uso: Copy
Arriba
«»
Define the method of the form: Función:methodForm ('strMethod');Parámetros:
strMethod : You can use either of the methods available form, GET or POST
Ejemplo de uso: Copy
Importante: If you are making the call to phpMyDataGrid from a form defined by you, you must use the same method used in form.
Arriba
«»
If you want to propagate your own GET or POST parameters, pass the data to the script, so it continue transferring the parameters in the dataGrid, for this, use: Función:linkparam("parameters");Parámetros:
parameters : You must set the parameter list in the same way that parameters of the type GET
Ejemplo de uso: Copy
Importante: 

The variables to be included in the list of parameters must have been previously caught, for instance, to capture the variable session:

If method = GET:
$session = $_GET['session'];

If method = POST:
$session = $_POST['session'];

If you do not know the request method or it can be mixed (GET and/or POST):
$session = (isset($_GET['session'])?$_GET['session']:(isset($_POST['session'])?$_POST['session']:''));

Note that the list of parameters are delimited by double quotes and the name of the variables enclosed between brackets {}, so, the variables are replaced by its record value.

Arriba
«»
If you want to have a context menu with options for maintenance, use the following line: Función:useRightClickMenu('classpath');Parámetros:
classpath : write the full path including filename for phpMyMenu class
Ejemplo de uso: Copy
Arriba
«»
To define the way it generates the HTML: Función:friendlyHTML(bolStat);Parámetros:
bolStat : true = for readable friendly HTML output
false = For obfuscated code
Ejemplo de uso: Copy
Arriba
«»
For compatibility with XHTML use this feature: Función:closeTags(bolStat);Parámetros:
bolStat : true = XHTML compatible code
false = HTML only code
Ejemplo de uso: Copy
Arriba
«»
To set the path where images are located: Función:pathtoimages('strPath');Parámetros:
strPath : Path to images
Ejemplo de uso: Copy
Arriba
«»
It is necessary to establish a connection to the database server to do that use the following function: Función:conectadb('strServer', 'strUsername', 'strPassword', 'strDatabase', 'useADOdb', 'strType', intPort);Parámetros:
strServer : Server Name or Server IP
strUsername : DataBase Username
strPassword : Password
strDatabase : Database Name
useADOdb : true = Will use ADOdb library for connection
false = Will use MySQL native drivers on php
strType : For connetions made with ADOdb, you can define the database Type to use
intPort : DataBase port
Ejemplo de uso: Copy
Importante: If you choose to use ADOdb library to make the connection, you must download it from ADOdb website, and must include the necesary files at the beginning of the script
Arriba
«»
The default language for messages phpMyDataGrid is English, if you want to change the language, use this function: Función:language('strLang');Parámetros:
strLang : Enter the two-character ISO code language
Ejemplo de uso: Copy
Importante: Available languages on phpMyDataGrid Professional are Spanish and English, if you want to add another language, you can just create the file in the languages folder.
Arriba
«»
To enable or disable maintenance icons, use: Función:buttons(bolAdd, bolUpd, bolDel, bolChk, intColumn, 'strColumnName');Parámetros:
bolAdd : true = Enable the option to add
false = Disable the option to add option
bolUpd : true = Enable the option to Edit
false = Disable the option to Edit Option
bolDel : true = Enable the option to Delete
false = Disable the option to Delete Option
bolChk : true = Enable the option to View
false = Disable the option to View option
intColumn : Define the column in which you want to display the maintenance icons (-1 indicates at the right side of the grid)
strColumnName : Complete this field, whether to show a title in the column of icons
Ejemplo de uso: Copy
Arriba
«»
To enable or disable the options for export, use the following function: Función:export(bolExportsheet, bolExportCSV, bolExportXML, bolPrinter, bolExportPDF, 'pdfOrientation');Parámetros:
bolExportsheet : true = Enable the option to export to worksheet (XLS)
false = Disable the option to export to worksheet (XLS)
bolExportCSV : true = Enable the option to export to CSV
false = Disable the option to export to CSV
bolExportXML : true = Enable the option to export to XML
false = Disable the option to export to XML
bolPrinter : true = Enable the option to print
false = Disable the option to print
bolExportPDF : true = Enable the option to export to PDF
false = Disable the option to export to PDF
pdfOrientation : Select the page orientation to export to PDF
(P) = Portrait
(L) = Landscape
Ejemplo de uso: Copy
Arriba
«»
If you want to have a column with checkboxes for multiple-choice, use the following function: Función:checkable(status);Parámetros:
status : true = Enable checkboxes column
false = Disable checkboxes column
Ejemplo de uso: Copy
Arriba
«»
To define a title in the grid, use: Función:TituloGrid('strTitle');Parámetros:
strTitle :
Ejemplo de uso: Copy
Arriba
«»
To define a footnote in the grid, use: Función:FooterGrid('strFooter');Parámetros:
strFooter :
Ejemplo de uso: Copy
Arriba
«»
To control the number of rows to display on each page: Función:datarows(intLines);Parámetros:
intLines : Number of entries per page
Ejemplo de uso: Copy
Arriba
«»
If you want to set the number of pages that appear before summarize with ... change the amount with this function: Función:linksperpage('amount');Parámetros:
amount : Enter the number of links that you want to display
Ejemplo de uso: Copy
Importante: Do not define very large quantities because they can distort the structure of the Grid
By setting linksperpage = 5, you'll look something like this: 1 2 3 4 5 ... 15 16 17 18 19 20 21 22 23 24 25 ... 45 46 47 48 49

Arriba
«»
To change the pagination format, use: Función:paginationmode('pgm',inTable);Parámetros:
pgm : Define the type of paging, there are 3 available values:

links = Generates a list page numbers indicating the page number to which the user want to go (Recommended tables with no more than 20 pages)
select = Generates a menu that lets you choose the number of page you want to go
mixed = Generates a list combining the above methods (default)
input = Set a input for the user type the page numbers
inTable : This parameter is not used anymore, left for backward compatibility
Ejemplo de uso: Copy
Arriba
«»
You can define a security code (Magic word) which will help to phpMyDataGrid to be safer: Función:salt('code');Parámetros:
code :
Ejemplo de uso: Copy
Arriba
«»
Set the number of decimal digits to be displayed in numeric fields: Función:decimalDigits('amount');Parámetros:
amount :
Ejemplo de uso: Copy
Arriba
«»
You can define the character you want to use as a decimal point: Función:decimalPoint('char');Parámetros:
char :
Ejemplo de uso: Copy
Arriba
«»
The online edition can be: off, activated with a single click and save when leave the field, or ask for confirmation to save. To define this, use: Función:ajax('style',clicks);Parámetros:
style : none = Disable online edition
default = Enables online edition with confirmation recording
silent = Enables online edition with automatic recording
clicks : Define the amount of clicks needed to activate the data for online edition.
1 - Single click
2 - Double click
Ejemplo de uso: Copy
Arriba
«»
If you want to differentiate on the screen the values that have been modified via AJAX, you can use this function: Función:AjaxChanged('strColor');Parámetros:
strColor : It must be a valid hex color
Ejemplo de uso: Copy
Arriba
«»
If for some reason needed to check whether a call is being made to AJAX page can use this function: Función:isAjaxRequest();Ejemplo de uso: Copy
Importante: 

if ($objGrid -> isAjaxRequest()){
echo 'This is an AJAX request';
} else {
echo 'This is a direct request';
}

Arriba
«»
You can customize the actions to do when a maintenance button is clicked: Función:setAction('button', 'event');Parámetros:
button :
event :
Ejemplo de uso: Copy
Importante: Considerations to have in mind to set new processes buttons:

Add button = None
Sample: $objGrid -> setAction('add','new_adicionar()');

Edit button = Function must have 2 parameters, delimited in the following way: (\"%s\",\"%s\");
Sample: $objGrid -> setAction('edit','new_editrow(\"%s\",\"%s\")');

Delete Button = Function must have 2 parameters, delimited in the following way: (\"%s\",\"%s\");
Sample: $objGrid -> setAction('delete','new_deleterow(\"%s\",\"%s\")');

Search Button = None
Sample: $objGrid -> setAction('search','new_search()');

View Button = Function must have 2 parameters, delimited in the following way: (\"%s\",\"%s\");
Sample: $objGrid -> setAction('view','new_viewrow(\"%s\",\"%s\")');

Arriba
«»
It is necessary to define the table on which the grid will work: Función:tabla('strTable');Parámetros:
strTable :
Ejemplo de uso: Copy
Arriba
«»
You can define a WHERE condition to filter and display only the records that meet the condition: Función:where('strWhere');Parámetros:
strWhere :
Ejemplo de uso: Copy
Arriba
«»
You can define a HAVING condition to filter and display only the records that meet the condition: Función:having('strHaving');Parámetros:
strHaving :
Ejemplo de uso: Copy
Arriba
«»
If you need to group records by some fields, or fields, you can use this function: Función:groupby('strGroup');Parámetros:
strGroup :
Ejemplo de uso: Copy
Importante: Note that when grouping data, the functionality of maintenance (Add, Edit, Delete, online edition), not function properly, therefore it is recommended to disable, or if necessary, implement your own maintenance processes.
Arriba
«»
Define the fields for which you want to sort the records: Función:orderby('fields','style');Parámetros:
fields : List of fields to which you want to sort the output, separated by commas
style : Define the type ordering type for each field ASC or DESC, if blank, ASC will be used automatically
Ejemplo de uso: Copy
Arriba
«»
The professional version has a feature which will allow you to order manually a set of records, which is useful for example to define the order in which products will appear on a page: Función:setorderarrows('field');Parámetros:
field : The consecutive field should not be the table ID
Ejemplo de uso: Copy
Importante: The ordering field should be consecutive and not be autoincrementable, for the examples that we have developed, its value is always the same as the autoincrementable ID value
Arriba
«»
By default, phpMyDataGrid enables the ordering arrows in the titles of all the columns, if you want to disable this feature use the following function: Función:noorderarrows();Ejemplo de uso: Copy
Importante: If you want to disable the ordering of a few columns only, DO NOT use this function, instead use chField specifying the necessary parameters.
Arriba
«»
phpMyDataGrid automatically generates SQL queries based on the information provided, but sometimes it is necessary to generate advanced queries that require the programmer defined them manually, to do this, use: Función:sqlstatement('strSQL','strCount');Parámetros:
strSQL :
strCount :
Ejemplo de uso: Copy
Importante: User defined SQL queries should not include sentences WHERE, GROUP or ORDER, these must be defined directly from the class functions.
You should have in mind that it is very important that all the names of fields used in the grid must be defined in the SQL query
Arriba
«»
For the developer it is essential to track the performance of the scripts, this feature allows to the programmer to receive emails with 'any' SQL errors that may be generated: Función:reportSQLErrorsTo('strMail', 'bolShow');Parámetros:
strMail : Developer e-mail
bolShow : true = Display SQL errors on the screen to end user (Recommended while developing))
false = Hides any generated SQL errors (Recommended for production environments)
Ejemplo de uso: Copy
Importante: This function uses the mail() php function, therefore to work properly, it must be configured and working
Arriba
«»
For maintenance options it is necesary to define a key fields, to do this, use: Función:keyfield('strField');Parámetros:
strField :
Ejemplo de uso: Copy
Arriba
«»
To allow search data in phpMyDataGrid, simply define the fields which will be allowed to search for: Función:searchby('listoffields');Parámetros:
listoffields : You can add the instruction :SELECT to field name to display a drop-down menu with the resume of all possible values to search.
Ejemplo de uso: Copy
Arriba
«»
If you like to set the 'Reset Search' button outside the grid, use this function: Función:getResetSearch(icon);Parámetros:
icon : Defines if the return data is just text or a icon, default: false
Ejemplo de uso: Copy
Arriba
«»
One of the main functions is FormatColumn, with this function you define the characteristics of each one of the fields displayed on grid: Función:FormatColumn('strfieldName','strHeader','fieldWidth','maxlength','inputtype','columnwidth','align','Mask','default','cutChar');Parámetros:
strfieldName : Field name
strHeader : Column Title
fieldWidth : Used only in textarea fields, it is used to set the textarea rows
maxlength : Max length allowed to be typed by user
inputtype : Field type
  0 = Normal Field
  1 = Read only field
  2 = Hidden field
  3 = Image, calc, link or imagelink without relation to a field
  4 = Image, calc or link related with a field
columnwidth : Column width (in pixels)
align : Column Text align
  center = (default)
  left
  right
Mask : Masking to field
  text = Normal field text
  textarea = Region for text editing (may have a larger area that the fields type text)
  image = Display an image, may be field related or static. (see samples)
  imagelink = Display a clickable image, may be field related or static. (see samples)
  number = Numeric field
  money = Numeric money sign field, format: money:sign, sample money:$ money:£
  date = Date type field, format: date:format:separator, sample date:dmy:/ date:ymd:-
  datetime = Date and time type field, format: datetime:dateformat:separator:timeformat,separator, sampledatetime:datetime:mdy:/:His,: or datetime:mdy:/:hisa,:
  link = Link field. view samples
  password = Password type field
  calc = Calculated field. view samples
  scalc = Calculated field which stores the result in a field, view samples
  bool = Boolean field, create a checkbox and store 0 when unchecked
  and 1 when checked
  check = same as bool type field
  select = Field with a dropdown menu, the options can be manually defined or dynamically loaded
from another table in the database.
  0 = Integer, no decimals
  1 = Float 1 decimal
  2 = Float 2 decimals
  3 = Float 3 decimals
  4 = float 4 decimals
  integer = Integer, no decimals
  related = Find a correspondence in other table based in the field value
  array() - conditional = Display a value based on a set of conditions that meet the field value. (see samples)
default : Default value for field (Used in add option)
cutChar : Used generally in textarea fields which are too long, by using this parameter the grid will only display the amount of X characters
Ejemplo de uso: Copy
Arriba
«»
You can define aditional atributes for each column: Función:chField('strfieldName', 'permissions', overwrite)Parámetros:
strfieldName : Field Name
permissions : N+ = Display field while adding
N- = Hide field while adding
E+ = Display field while editing
E- = Hide field while editing
V+ = Display field while viewing records
V- = Hide field while viewing
R = Remove order arrows for field
U = (only for imagetype fields) allow new images to be uploaded to the field
M = (only for imagetype fields) Allow images to be uploaded, no matter if field already has an image on it
X+ = To export hidden fields in grid
X- = To not export visible fields
overwrite : Define whether the definitions made earlier to the field must be erased or cumulative
Ejemplo de uso: Copy
Importante: You would combine several atributes in the same request, sample:
$objGrid -> chField('firstname','N-E+V+R');
Arriba
«»
Define the size for the input boxes when editing/adding: Función:setInputWidth('field','width');Parámetros:
field :
width :
Ejemplo de uso: Copy
Arriba
«»
If you want to validate user input data via Javascript use: Función:jsValidate('strField', 'strValidation', 'strErrorMessage', 'strDisplayMessage');Parámetros:
strField : FieldName
strValidation : JavaScript code to validate, (You can call a JS function as well)
strErrorMessage : Error Message
strDisplayMessage : Input instructions message
Ejemplo de uso: Copy
Importante: Javascript validations will be executed on New and Edit options, as well in online edition, please keep in mind you can validate only the actual field (this.) validations can not be done combined with other fields
Arriba
«»
To Just display an instructions message to user, use: Función:fldComment('strField', 'strDisplayMessage');Parámetros:
strField : Field name
strDisplayMessage : Input instructions message
Ejemplo de uso: Copy
Importante: Those messages will be available in Add and Edit options only.
Arriba
«»
If you like to use a datepicker, you should use this function: Función:useCalendar(bolCalendar);Parámetros:
bolCalendar :
Ejemplo de uso: Copy
Arriba
«»
To totalize columns, use: Función:total('fields');Parámetros:
fields : List of fields to totalize, comma separated
Ejemplo de uso: Copy
Importante: Remember, now you can totalize calculated colums as well
Arriba
«»
Define the size (width, height) to display the pictures in a field: Función:setImageSize('field','width','height');Parámetros:
field : Field Name
width : Width in px (just the integer value)
height : Height in px (just the integer value)
Ejemplo de uso: Copy
Importante: This function do not resize the stored images, just resize the output image in browser.
Arriba
«»
Lets you set a conditional format to CELLS that meet a condition: Función:addCellStyle('field','condition', 'style');Parámetros:
field : Field Name
condition : String, condition.
style : Name of the CSS class to use
Ejemplo de uso: Copy
Importante: It is possible to use any field used within the grid, simply type the field name between [' ... '].
Arriba
«»
Lets you set a conditional format to ROWS that meet a condition: Función:addRowStyle('condition', 'style');Parámetros:
condition : String, condition.
style : Name of the CSS class to use
Ejemplo de uso: Copy
Importante: It is possible to use any field used within the grid, simply type the field name between [' ... '].
Arriba
«»
Define the path for skin related images: Función:skinimages('skin', 'path');Parámetros:
skin : Skin name
path : Path to images
Ejemplo de uso: Copy
Importante: The %s in path will be replaced by skin name, if this %s does not exist, the path will be used as is.
Arriba
«»
Changes the value to store instead of the specified in the online edition: Función:setNewInlineData('newData');Parámetros:
newData : New data to store when editing online
Ejemplo de uso: Copy
Arriba
«»
Define a JS function to run after updating online, may have the parameters (idkey,field,newtext,oldtext): Función:onAjaxUpdate('js');Parámetros:
js : JavaScript function name to call when the Online edition finishes
Ejemplo de uso: Copy
Arriba
«»
Returns the value of the AJAX action being executed: Función:getAjaxID();Ejemplo de uso: Copy
Arriba
«»
Returns codes of the selected checkboxes: Función:getCheckedBoxes();Ejemplo de uso: Copy
Arriba
«»
Returns true if the AJAX action is Adding data: Función:isadding();Ejemplo de uso: Copy
Arriba
«»
Returns true if the request is an online edition: Función:isOnlineEdition();Ejemplo de uso: Copy
Arriba
«»
Returns the data is being edited online: Función:getEditedData();Ejemplo de uso: Copy
Arriba
«»
Set an image by aplying a new parameter: Función:changeImage();Ejemplo de uso: Copy
Arriba
«»
Add a separator in the toolbar: Función:addSeparator();Ejemplo de uso: Copy
Importante: This feature is only valid if property toolbar is true
Arriba
«»
Add Buttons to the toolbar: Función:addButton('img', 'action', 'message');Parámetros:
img : Path and image name of the icon to display
action : Javascript funcion to call when the button is selected
message : Message to display at side of the icon
Ejemplo de uso: Copy
Importante: This feature is only valid if property toolbar is true
Arriba
«»
Add a select menu to toolbar: Función:addSelect('arrData', 'action', 'message');Parámetros:
arrData :'toDisplay1','key2'=>'toDisplay2','key3'=>'toDisplay3','keyN'=>'toDisplayN')' onblur='ut("$objGrid","58","addSelect(¬c¬arrData¬c¬, ¬c¬action¬c¬, ¬c¬message¬c¬);","ta58","arrData,action,message",false)' />
action : Name of the JavaScript function to execute
message : Message to display at side of the icon
Ejemplo de uso: Copy
Importante: This feature is only valid if property toolbar is true
Arriba
«»
This function is available for backward compatibility, it is not recommended to be used, instead you would insert the JS and CSS files by yourself or use the function set_DG_Header: Función:setHeader('phpScriptFile', 'jsFile', 'cssFile', 'jsCalFile', 'cssCalFile', 'jsmmenu');Parámetros:
phpScriptFile : php script name
jsFile : path and name to datagrid JS file
cssFile : path and name to datagrid CSS file
jsCalFile : path and name to calendar JS file
cssCalFile : path and name to calendar CSS file
jsmmenu : path and name to right click menu
Ejemplo de uso: Copy
Arriba
«»
Finally, call this function which will render the grid based on all settings previously provided: Función:grid();Ejemplo de uso: Copy
Arriba
«»
If you need to pass parameters to a query is recommended to use this function which will analyze the contents of the variable, and amended if necessary to prevent SQL injections.: Función:magic_quote($variable);Ejemplo de uso: Copy
Importante: Note that this function is not part of the DataGrid class, and therefore should not be called as an object but as independent function!
Arriba
«»
It is recommended to include JS and CSS files, by using this function, see examples for details: Función:set_DG_Header('path/to/JS/', 'path/to/CSS/', 'closetagChar', 'skinName')Ejemplo de uso: Copy
Importante: Note that this function is not part of the DataGrid class, and therefore should not be called as an object but as independent function!
Arriba
«»