phpLens
 home  products examples manual  faq support forum  contact news  login store

More Examples:   View Source:   Creating, Editing and Deleting Demo

Free Download

To create new records, click on the icon in the menu on the top-right of the grid. To edit, click on

See also Example 320 for an alternative editing interface with a Child Editor in the Details Grid.

This is a Demo. You can not change anything for security reasons.
Back to Grid     phpLens Settings  Column Settings   Choose   Generate PHP Code   Remove All Settings   ?  
 
Cancel
FieldUSERID   Type: string[48]   Change Type
Default Title
Grid Title
Edit Title 2 Fields in Row
New Title 2 Fields in Row
Edit Notes
Use {KEY} to incorporate primary key, and prefix ?EDIT? or ?NEW? to display note only in EDIT or NEW state
Detail Title 2 Fields in Row
Filter Title
Input Dimensions
(suggested size: 48 x 1)
Columns:   Rows:

Power Lens
Lookup Values
Input Type       Enter a lookup to allow check boxes and radio buttons
# check/radio columns
Overlib Text
Search Lookup when editing
Matching above sql with fields
Minimum character length   Search mode   Hide key code
Validation
 X: 0-9 A-Z             x: 0-9 A-Z optional       Z: 0-9 A-Z _            z: 0-9 A-Z _ optional
#: 0-9 9: 0-9 optional +: positive numbers only
&: any character ?: any character optional \: escape character >: to uppercase <: to lowercase =EMAIL: email validation
Validation Error Msg
Default New Value
Prefix value with = to execute PHP code and % for SQL function
Optional Editable ColumnEnabled when Column   has value Enter A^B^C, or * for any non-empty value
Power Edit Lens
Grid TD Attributes   (nowrap, width=30%, align=center etc.)
Cell Color grid^title^input  
Color Reference opens in a new window

Section Break Title
Back color   CSS class

WYSIWYG Editor for fields that accept HTML
Do not convert
Special Chars
This Field supports Double-Byte (eg Chinese, Japanese) and HTML tags
Must FillYes   * Must Fill Columns
Read OnlyYes   - Read Only Columns
Visible in GridYes   Grid Columns
Visible in DetailsYes   Detail Columns
Visible in New RecordYes   * New Record Columns
Visible in Edit RecordYes   * Edit Columns
  Cancel
PHPLens: 4.9.2   Data: 0.02   DB: mysql   adodb: 4.62   Compat: 2   PHP: 5.2.17   OS: Linux
License Type: Enterprise   ID: (Natsoft;John Lim;jlim@natsoft.com)   Valid Till: Never Expires

Notes

When editing or creating new records, userid and password are set as must fill fields. Age only accepts numbers (this is automatic, no programming required), and email addresses are validated.

See Example 302 and Example 303 which uses the same data.

Table schema

  create table lensusers (
      USERID char(16) not null,
    PASSWORD char(16) not null,
      FIRSTNAME char(24) ,
    LASTNAME char(24) not null,
    EMAIL char(48) not null,
    ADDRESS1 char(48) not null,
    ADDRESS2 char(48) ,
    POSTCODE char(12) ,
    CITY char(24) ,
    STATE char(24) ,
    COUNTRY char(24) not null,
    AGE integer,
    CREATED datetime not null,
    LASTMOD datetime not null,
    primary key (userid)
  );
  

This demo also shows you Google style scrolling. In this case, this is enabled by setting

  $lens->scrollLinks = 9
  

which sets the number of scrolling links to 9.

sameRowLens

Also notice that the fields FirstName/LastName and PostCode/City are on the same line in the Details Grid, and New/Edit record forms. This is configured by checking "2 Fields in 1 Row" in the column settings for PostCode.

sectionLens

We also have section breaks with "Misc" and "Address" using the sectionLens property.

email: contact#phplens.com (change # to @)     telephone (malaysia): 60-3-7947 2888     fax (malaysia): 60-3-7947 2800