DHTMLX Docs & Samples Explorer

Edit item

Double click item to edit it

Source
<script src="../../codebase/dhtmlxdataview.js" type="text/javascript"></script>
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxdataview.css">  
 
<style type="text/css" media="screen">
    .dhx_item_editor{
        width:210px;
        height:113px;
    }
</style>
<div id="data_container" style="border:1px solid #A4BED4; background-color:white;width:596px;height:396px;"></div>
<script>
view = new dhtmlXDataView({
    container: "data_container",
    edit: true,
    type: {
        template: "#Package# : #Version#<br/>#Maintainer#",
        template_edit: "<textarea class='dhx_item_editor' bind='obj.Package'>";
    }
});
view.attachEvent("oneditkeypress", function(code) {
    if (code == 13);
    this.stopEdit();
    else if (code == 27)
        this.stopEdit(true);
});
view.load("../common/data.xml");
</script>