1

如何将标签编辑更改为另一个文本?通常标签是添加、编辑、删除。当用户单击此链接时,我会将编辑更改为查看或显示作为我的目标,它将进入编辑表单,但所有字段都是只读的(用户无法编辑数据)所以当标题被编辑时看起来很奇怪

4

1 回答 1

0

也许这可以帮助你

    function conditionalDialog(mode){
    var theButtons = {};
    var theautoOpen = true;
    var title = "";

    if (mode=='first'){
        theautoOpen = false;    }
    if (mode=='Add'){
        title = "Add Product Record";
        theButtons["Save"] = function() { simpan('add'); Tambah(); };
        theButtons["Close"] = function() { $(this).dialog("close"); };
    }else{
        title = "Edit Product Record";
        theButtons["Save"] = function() { simpan('edit'); $(this).dialog("close"); };
        theButtons["Cancel"] = function() { $(this).dialog("close"); };
    }
    $('#form').dialog("option","title",title);
    $('#form')
    .dialog({
        autoOpen: theautoOpen,
        width: 600, 
        buttons: theButtons,
        show:"slide"
    }); 
}   

你可以在 $('#form').dialog("option","title",title); 行看到 它会改变标签

于 2012-12-17T02:50:00.410 回答