Not able to update the celll data

Not able to update the celll data

vaibhavivaibhavi Posts: 3Questions: 3Answers: 0

Hi,
after doing lots of trials i could finally show my datatable in editable mode.
when select any celll and try to update cell by hitting enter button i cant see the updated text.
Instead of updated text ,whole page is rendered in cell..

HTML

</div>

<div id="demo">
    <h2>Ajax example</h2>
    <table id="EditorExample" class="display">
        <thead>
            <tr>
                <th>EmployeeID</th>
                <th>FirstName</th>
                <th>MiddleName</th>
                <th>Surname</th>
                <th>Designation</th>

            </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
</div>

<link href="../media/css/dataTables.tabletools.css" rel="stylesheet" />
<link href="../media/css/TableTools.css" rel="stylesheet" />
<script type="text/javascript" src="/media/js/dataTables.tableTools.js"></script>
<script type="text/javascript" src="..js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../js/jquery.jeditable.js"></script>
<script type="text/javascript" src="../js/jquery-ui.js"></script>
<script type="text/javascript" src="../js/query.dataTables.editable.js"></script>
<script type="text/javascript" src="/media/ZeroClipboard/ZeroClipboard.js"></script>
<script type="text/javascript" src="../js/jquery.dataTables.editable.js"></script>
<script type="text/javascript" src="/js/EditCellData1.js"></script>

EditCellData1.js

$(document).ready(function () {

$('#EditorExample').dataTable({
    'bProcessing': true,
    'bServerSide': true,
    'sAjaxSource': 'EditCellData.aspx/getConfDefaultValues',
    "fnServerData": function (sSource, aoData, fnCallback) {
        var data;

        $.ajax({
            type: "POST",
            url: sSource,
            data: null,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            "beforeSend": function () {
              //  showProcessingScreen(msgProcessing);
            },
            success: function (data) {
                // $.unblockUI();
                if ($.parseJSON(data.d).Status == 'Success') {
                    fnCallback($.parseJSON(data.d));
                }
                else {
                   // showProcessingScreen($.parseJSON(data.d).Parameter);
                }

            },
            error: function (result) {
                //$.unblockUI();
                //showProcessingScreen(errorMsg);
            }
        });
    },

    "bJQueryUI": true,
    "sPaginationType": "full_numbers",
    "aaSorting": [[0, "asc"]],
    "bProcessing": false,
    "bUseRendered": false, "bLengthChange": false, // to remove page length dropdown

    "aoColumns": [

                {
                    "title": "EmployeeID",
                    "mData": "EmployeeID",
                    "bSearchable": true,
                    "bSortable": true,
                    "sClass": "alignLeft",
                },
                {
                    "title": "FirstName",
                    "mData": "FirstName",
                    "bSearchable": true,
                    "bSortable": true,
                    "sClass": "alignLeft",
                },

                {
                    "title": "MiddleName",
                    "mData": "MiddleName",
                    "bSearchable": true,
                    "bSortable": true,
                    "sClass": "alignLeft",
                },
                   {
                       "title": "Surname",
                       "mData": "Surname",
                       "bSearchable": true,
                       "bSortable": true,
                       "sClass": "alignLeft",
                   },
                {
                    "title": "Designation",
                    "mData": "Designation",
                    "bSearchable": true,
                    "bSortable": true,
                    "sClass": "alignLeft",
                }
    ]
}).makeEditable({
    sUpdateURL: 'EditCellData.aspx/updateConfValues',
    'aoColumns': [
        {
            tooltip: 'EmployeeID',
            oValidationOptions: {
                rules: { value: { minlength: 3 } },
                messages: { value: { minlength: 'Min length - 10' } }
            }
        },
        {
            tooltip: 'FirstName',
            oValidationOptions: {
                rules: { value: { minlength: 3 } },
                messages: { value: { minlength: 'Min length - 10' } }
            }
        },
        {
            tooltip: 'MiddleName',
            oValidationOptions: {
                rules: { value: { minlength: 5 } },
                messages: { value: { minlength: 'Min length - 10' } }
            }
        },
        {
            tooltip: 'Designation'

        },
        {
            tooltip: 'Surname'
        },

    ],

    sDeleteURL: 'EditCellData.aspx/deleteData',
    sDeleteRowButtonId: 'btnDeleteMemRow',
});

});

</asp:Content>

This discussion has been closed.