Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何将日志添加到jqgrid列中?_Jquery_Jqgrid - Fatal编程技术网

Jquery 如何将日志添加到jqgrid列中?

Jquery 如何将日志添加到jqgrid列中?,jquery,jqgrid,Jquery,Jqgrid,这是我正在尝试的示例代码 { name : 'scopeName', index : 'scopeName', width: '400px', resizable : true, align : "left", editable : true, edittype : "select", editoptions : { value : getSeq

这是我正在尝试的示例代码

{
        name : 'scopeName',
        index : 'scopeName',
        width: '400px',
        resizable : true,
        align : "left",
        editable : true,
        edittype : "select",
        editoptions : {
            value : getSequenceNumbers()
        },
        editrules : {
            required : true
        }

function:

    function getSequenceNumbers() {
        alert("here123");
        $.getJSON("http://localhost:8039/ReleaseManagementApp/releasemgmt/config/Q2FY16/scope", null, function(data) {
        if (data != null) {
            alert("here");
            //construct string.  
            //(or the server could return a string directly)
            for (var i=0; i<data.length; i++) {
                sel.append('<option value="' + data[i].scopeName + '">' + data[i].scopeName + '</option>');
            }
        }
    });
}

我想知道是否可以将上述响应中的scopeName作为选择选项卡填充到jqgrid中。

相反,我建议您为此使用自定义格式化程序:

{
    name : 'scopeName',
    index : 'scopeName',
    width: '400px',
    resizable : true,
    align : "left",
    formatter:getSequenceNumbers // <----use the function here
}
{
名称:“scopeName”,
索引:“scopeName”,
宽度:“400px”,
可调整大小:正确,
对齐:“左”,
格式化程序:GetSequenceNumber//
{
    name : 'scopeName',
    index : 'scopeName',
    width: '400px',
    resizable : true,
    align : "left",
    formatter:getSequenceNumbers // <----use the function here
}
function getSequenceNumbers() {
        alert("here123");
        var sel = '<select>';
            sel +='<option value="select">Select...</option>';
        $.getJSON("url", null, function(data) {
        if (data != null) {
            alert("here");
            //construct string.  
            //(or the server could return a string directly)
            for (var i=0; i<data.length; i++) {
                sel += '<option value="' + data[i].scopeName + '">' 
                        + data[i].scopeName + '</option>';
            }
            sel +="</select>";
        }
    });
    return sel;
}