php頁面重新整理

來源:互聯網
上載者:User
重新整理|頁面

refresh1.php新增後重新整理顯示:echo "<script language='Javascript'>
              window.dialogArguments.parent.dialog_main.tb_addnew('".$task_insert_id."', '".$sc."',
                                                                  '".$Mlist2['owner']."', '".$Mlist2['start_date']."', '".$Mlist2['end_date']."');
               window.close();
        </script>";
exit;

 refresh.ihtml

<Script language="Javascript1.2">
    //editor_generate('txt_content');
function numberCells(){  顯示增加表格函數
    var count=0;
    for (i=0; i<document.all.table_add.rows.length; i++) ...{
        for (j=0; j<document.all.table_add.rows(i).cells.length; j++) ...{
            document.all.table_add.rows(i).cells(j).innerText=count;
            count++;
        }
    }
}

function tb_addnew(id1,t1,t2,t3) { 插入一條記錄
    var ls_t=document.all("table_add");
    maxrow=ls_t.rows.length;
    maxcell=ls_t.rows(0).cells.length;
    mynewrow=ls_t.insertRow();
   
    for (i=0; i<maxcell; i++) {
        if (i==0) t0=id1; 必須顯示列值id,才能實現即時重新整理
        else if (i==1) t0=t1;
        else if (i==2) t0=t2;
        else if (i==3) t0=t3;
        else if (i==4) t0=" 
                       <input type='button' name='btn_edit21' value='#' onClick='javascript:tb_edit("+id1+");'> 
                       <input type='button' name='btn_minus21' value='-' onClick='javascript:tb_delete("+id1+");'>";
        else if (i==5) t0="<input id='checkbox' name='checkbox[]' type='checkbox' value='idl' $checkbox_checked >";
        mynewcell=mynewrow.insertCell();
        //mynewcell.innerText=t0;   //在<td>  </td>之間不包含html的內容
        mynewcell.innerHTML=t0;   //包含html的內容
    }

   
}

function tb_edit(sid) ...{
    open_dialog('refresh1.php?action=edit&sid='+sid,'topic_edit','600','600');
}

function tb_view(sid) ...{
    open_dialog('refresh1.php?action=view&sid='+sid,'topic_edit','600','600');
}

function tbrow_edit(sid,t1,t2,t3,t4) ...{
    var ls_t=document.all("table_add");
    maxrow=ls_t.rows.length;
    for (i=0; i<maxrow; i++) ...{
        if (ls_t.rows(i).cells(0).innerHTML==sid) ...{
            ls_t.rows(i).cells(1).innerHTML=t1;
            ls_t.rows(i).cells(2).innerHTML=t2;
            ls_t.rows(i).cells(3).innerHTML=t3;   //只需顯示到修改的列
            //ls_t.rows(i).cells(4).innerHTML=t4;
            break;
        }
    }
}

function tb_delete(sid) ...{
    if (confirm("確定要刪除嗎?")) ...{
        open_dialog('refresh1.php?action=delete&sid='+sid,'topic_delete','600','400');
        //var ls_t=document.all("table_add");
        //ls_t.deleteRow();
    }
}

function tbrow_delete(sid) ...{   
    var ls_t=document.all("table_add");
    maxrow=ls_t.rows.length;
    for (i=0; i<maxrow; i++) ...{
        if (ls_t.rows(i).cells(0).innerHTML==sid) ...{
            //window.alert(i);
            ls_t.deleteRow(i);
            break;
        }
    }   
}
</Script>
<Script language="Javascript1.2">
    //editor_generate('problem_desc');
    //editor_generate('problem_reason');
    //editor_generate('settle_desc');
    //editor_generate('amend_desc');
    //editor_generate('assess_desc');
</Script>

當需要兩個重新整理架構時,可寫兩次該代碼,只是函數不用重名。

 



相關文章

Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。