developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 12 years ago

Closed 12 years ago

#728 closed new feature (fixed)

jForms: new addControlBefore() method

Reported by: Julien Owned by: Julien
Priority: normal Milestone: jelix 1.1
Component: jelix:forms Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

For some reason, I needed to add a control dynamically at the beginning of my jForm (last update date, not set if the entry has not been modified, and makes no sens if the form is used for creation, ...)

So I created an addControlBefore() method, that works like this :

$c = new jFormsControlOutput('update_time');
$c->label = 'Last update';
$form->addControlBefore($c,'name');

This will add my output control just before the control with "ref" attribute = "name".

Verified that current unit tests work well.

Attachments (1)

728-jForms-addControlBefore.diff (2.1 KB) - added by Julien 12 years ago.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by Julien

comment:1 Changed 12 years ago by Julien

  • Status changed from new to assigned

comment:2 Changed 12 years ago by laurentj

  • review changed from review? to review+

good idea :-)

comment:3 Changed 12 years ago by Julien

  • Resolution set to fixed
  • Status changed from assigned to closed

commit done in the trunk

Note: See TracTickets for help on using tickets.