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.

  PHPLens
E New Srch
(E) (e)User ID (e)Name (e)email  
1123456124345 12345test@test.com
[Del][Edit]
 
(E)  
(e)User ID123456
(e)First Name124345 12345
(e)Last Name  
12345
(e)emailtest@test.com
  Address 
(e)Address Line 1123
(e)Address Line 2123
(e)Postcode123
(e)City  
123
(e)State123
(e)Country123
  Misc 
(e)Age12
(e)Created30-Jan-2012 06:40:42 PM
  PHPLens (Page 1/1)  
E New Srch

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