2012-05-06 15 views
1

これを実装するためのダイアログをポップアップしたくありません。つまり、インプレースエディタが必要です。フレキグリッドでデータを編集する方法

+3

あなたは私たちにいくつかのコンテキストを与えることはできますか? – gdoron

+0

なぜ私の質問に-4があるのですか? –

+1

私はそれがコンテキストの欠如のためだと思います。「フレキシグリッド」とは何ですか? DOM構造は何ですか?なぜあなたはそれが必要なのですか? 'フレキシグリッド'はどのように見つけることができますか?それらのすべてがここにいたならば、それはまだ推薦サービスではないSOのトピックではありません。 **あなたの問題に幸運を!** – gdoron

答えて

4

私はこれを行う方法を見つける。 次jquery.editinplace を使用すると、私のコードです:

<script type="text/javascript" src="./js/jquery.editinplace.js"></script> 
function editDescription(celDiv, id){ 

    $(celDiv).click(function() { 
    var idTd = $(celDiv).parent().parent().children()[1]; 
    $(celDiv).editInPlace({ 
     url: "http://localhost:8081/kaimei/update_description", 
     params: "address="+$(idTd.children).html(), 
     error:function(obj){ 
     alert(JSON.stringify(obj)); 
     }, 
     success:function(obj){ 
     var str = m[JSON.parse(obj).status+""][window.curLanguage]; 
     alert(str); 
     $("#displays").flexReload(); 
     } 
    }); 
    }); 
} 

$(document).ready (function() { 

    $("#displays").flexigrid (
    { 
     url: 'http://localhost:8081/kaimei/load_displays', 
     method:'GET', 
     dataType: 'json', 
     width: 400, 
     height: 300, 
     colModel : [ 
     {hide: '勾选', name: 'check', width: 30, sortable: true, align: 'left'}, 
     {display: 'ID', name: 'id', width: 90, sortable: true, align: 'left'}, 
     {display: '描述信息', name: 'description', width: 110, sortable: true, align: 'left',process:editDescription}, 
     {display: '状态', name: 'status', width: 20, sortable: true, align: 'left'} 
     ] 
    } 
    ); 
}); 
関連する問題