Date index for Sep 2003


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

add functionality (type of node)



Hello Ivo,

What are you think about adding the above mentioned functionality:

Display different set of fields depends of value field "type"

Example: node 'contracts' have field contracttype; and different type of
customer contracts may have different set of fields for editing:

class contracts extends atkNode
{
  function contracts()
  {
    global $ATK_VARS;

    $this->atkNode("contracts",NF_EDITAFTERADD);

    $this->addAttribute(new
atkAttribute("id",AF_PRIMARY|AF_AUTO_INCREMENT|AF_HIDE));
.
    $this->addAttribute(new
atkManyToOneRelation("contracttype","contracttype",AF_SEARCHABLE|AF_OBLIGATO
RY|AF_FORCE_LOAD|AF_READONLY_EDIT));
  
        switch($ATK_VARS["atktype"]){
        case '1':
      $this->addAttribute(new atkAttribute("atr1"));
      $this->addAttribute(new atkAttribute("atr2"));
      $this->addAttribute(new atkAttribute("atr3"));
          break;
        case '2':
      $this->addAttribute(new atkAttribute("atr4"));
      $this->addAttribute(new atkAttribute("atr5"));
      $this->addAttribute(new atkAttribute("atr6"));
          break;
	}

.
}
}

Best regards,

Yury

http://www.achievo.org/lists achievo.org - ©1999-2002 ibuildings.nl BV