如何在表格Html中添加contenteditable

时间:2017-05-17 06:27:30

标签: php html ajax

我不知道如何在这里添加contenteditable。我可以添加纯HTML,但在这里我无法添加。

<html:list 
  id="dataTable" 
  style="dataTable" 
  name="deal" 
  checkbox="true" 
  action="true" 
  datasource="list" 
  contenteditable="true"
  show="id:{%ID}|50px
    ,deal_name|get_paymentnotice_title=$deal:{%PROJECT_TITLE}
    ,ngo|get_ngo_name:{%NGO}|80px
    ,project:{%Project}|80px
    ,name:{%Username}
    ,email: Email
    ,mobile:{%Phone}|80px
    ,order_id:Joygive Payment Id
    ,payment_id|get_payment_name=$deal:Payment Gateway
    ,transaction_number:Transaction Number
    ,payment_method:Payment Method
    ,id|get_payment_name=$deal:Email Notification"
>

1 个答案:

答案 0 :(得分:0)

在列表功能中添加contenteditable

我们可以像这样添加

<td><input contenteditable="true" type="checkbox" name="key" class="key" value="{$'.$name.'.'.$pk.'}"></td>

完整的功能是,

public function _list($attr)
{

    $tag        = $this->parseXmlAttr($attr,'list');
    $id         = $tag['id'];                       //FormID
    $datasource = $tag['datasource'];               //Data source list displayedVoListName
    $pk         = empty($tag['pk'])?'id':$tag['pk'];//Primary keys, defaultid
    $style      = $tag['style'];                    //StyleName
    $name       = !empty($tag['name'])?$tag['name']:'vo';                 //VoObjectName
    $action     = $tag['action'];                   //WhetherFeaturesOperating
    $checkbox   = $tag['checkbox'];                 //WhetherCheckbox
    if(isset($tag['actionlist'])) {
        $actionlist = explode(',',trim($tag['actionlist']));    //Specifies the feature list
    }
    if(substr($tag['show'],0,1)=='$') {
        $show   = $this->tpl->get(substr($tag['show'],1));
    }else {
        $show   = $tag['show'];
    }
    $show       = explode(',',$show);                //The list displays a list of fields

    //Calculate the number of columns of the table
    $colNum     = count($show);
    if(!empty($checkbox))   $colNum++;
    if(!empty($action))     $colNum++;

    //Display Start
    $parseStr   = "<!-- Think System components start list -->\n";
    $parseStr  .= '<table id="'.$id.'" class="'.$style.'" cellpadding=0 cellspacing=0 >';
    $parseStr  .= '<tr><td colspan="'.$colNum.'" class="topTd" >&nbsp; </td></tr>';
   $parseStr .= '<td><input contenteditable="true" type="checkbox" name="key" class="key" value="{$'.$name.'.'.$pk.'}"></td>';
    $parseStr .= '</tr></table>';
 }