可编辑的数字类型未定义


X- Editable Undefine in number type

我使用x可编辑。但我只想输入数字,min = 0。Max是100,但是我变成这样了。

http://localhost/bismillah/livetableedit/process.php?id=1&data=undefined&key=name

undefine in data.

我的代码。

while($fetch = mysql_fetch_array($query))
                    {
                        if($i%2==0) $class = 'even'; else $class = 'odd';
                        echo'<tr class="'.$class.'">
                                <td>'.$no.'</td>
                                <td class="xedit" id="'.$fetch['id'].'" key="name" data-type="number" min="0" max="100">'.$fetch['name'].'</td>
                                <td class="xedit" id="'.$fetch['id'].'" key="details">'.$fetch['details'].'</td>
                                <td class="xedit" id="'.$fetch['id'].'" key="status">'.$fetch['status'].'</td>
                            </tr>'; 
                        $no++;                      
                    }

这是我的javascript代码

jQuery(document).ready(function() {  
    $.fn.editable.defaults.mode = 'popup';
    $('.xedit').editable();     
    $(document).on('click','.editable-submit',function(){
        var key = $(this).closest('.editable-container').prev().attr('key');
        var x = $(this).closest('.editable-container').prev().attr('id');
        var y = $('.input-sm').val();
        var z = $(this).closest('.editable-container').prev().text(y);

        $.ajax({
            url: "process.php?id="+x+"&data="+y+"&key="+key,
            type: 'GET',
            success: function(s){
                if(s == 'status'){
                $(z).html(y);}
                if(s == 'error') {
                alert('Error Processing your Request!');}
            },
            error: function(e){
                alert('Error Processing your Request!!');
            }
        });
    });

});

我尝试像这样修改代码

<a href="#" class="xedit" data-type="number" id="'.$fetch['id'].'" key="name">'.$fetch['name'].'</a>

但是同样的问题,你知道吗?

注意:我从这里得到这个

http://www.jqueryajaxphp.com/live-table-edit-using-jquery-ajax-and-php-twitter-bootstrap/

谢谢

假设您的process.php是正确的,您只需要将键更改为"key= " number"