1

If alert view then OK, but is add code select append, not working - undefined Here is code:

function getListItemById(webUrl,listName, itemId, success, failure) {
    var url = webUrl + "/_vti_bin/listdata.svc/" + listName + "(" + itemId + ")";
    $.ajax({
        url: url,
        method: "GET",
        headers: { "Accept": "application/json; odata=verbose" },
        success: function (data) {
            success(data.d);
        },
        error: function (data) {
            failure(data.responseJSON.error);
        }
    });
}

getListItemById('http://sharepoint/','Task',1,function(taskItem){ //alert(taskItem.Tabn); //alert(taskItem.Xul); //var Tabn = ($(this).attr(taskItem.Tabn)); //var Tabn = taskItem.Tabn.toString(); //alert(Tabn); //$("#State").val(taskItem.Tabn); $("#test").append(""+ $(this).attr(taskItem.title) + ""); }, function(error){ console.log(JSON.stringify(error)); } );

"'

0

Changed option select, now working

$('#test')
    .append($("")
    .attr("value",taskItem.Tabn)
    .text(taskItem.Tabn));
},

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy