lundi 31 août 2015

Object prototype and class in Javascript

I'am working with javascript but I've doubts with my code because the function does not work as I want. This is my code:

classDescuentos = function () {
};

classDescuentos.prototype = {
var cellsEditar = function (row, column, columnfield, value, defaulthtml, columnproperties) {
            var data = grid.jqxGrid('getrowdata', row);
            var style = "";

            if (data.editar == 't' && data.apr_ger == 'f') {
                style = "display:block";
            } else {
                style = "display:none";
            }

            var html = "";
            var activarBotEnv = actBtn;
            html = "<div id='activarEdicion_" + row + "' style='width:99%;text-align:center;" + style + "' ><a href='#' id='editarHora' name='editarHora' title='Editar Total horas descontar' onclick=classDescuentos.prototype.editarHora(" + row + ");><img style='padding-bottom: 0px' height='17px' width='17px' src=../../../media/img/edit.png></a></div>";
            return html;
        };

editarHora: function (row) {
        var grid = $(this.gridData);
        grid.jqxGrid('setcolumnproperty', 'des_hor_ger_format', 'editable', true);
        grid.jqxGrid('begincelledit', row, "des_hor_ger_format");

        grid.on('cellendedit', function () {
            grid.jqxGrid('setcolumnproperty', 'des_hor_ger_format', 'editable', false);
        });
    }
};

Should allow edit the data of a cell of a jqxGrid of JQWidget and take the data that is entered but still leaves the original data before modifying it.

What am I doing wrong does not work?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire