Having trouble with hiding a column
Having trouble with hiding a column
 aguy0612            
            
                Posts: 1Questions: 1Answers: 0
aguy0612            
            
                Posts: 1Questions: 1Answers: 0            
            Script is calling for 3 4 columns, I want to hide the last one called cformClientNumber in the call done function.
ExecuteOrDelayUntilScriptLoaded(Init,"SP.js");
//  function helloTest() {
//     alert("hello now");
//   }
function IsNew(value)
{
if(value == "Existing Client")
{
    $(".existing").show();
} else {
    $(".existing").hide();
}
}
function GetEngNum(clientNumber)
{
    //var clientNumber = $.trim($("#clientNumber").val());
    //var RESTQuery = "hello";
    //var RESTQuery = "/_api/Web/Lists/GetByTitle('cformEngagementLog')/items?"+
    //"$select=cformClientNumber&$filter=(substringof('"+ clientNumber+"',cformClientNumber) or startswith(cformClientNumber,'"+clientNumber+"'))"; 
    var RESTQuery = "/_api/Web/Lists/GetByTitle('cformEngagementLog')/items?"+
            "$select=cformEngagementNum,cformClientName,cformProjectName,cformEngEMContact,cformClientNumber&$filter=(substringof('"+clientNumber+"',cformEngagementNum) or startswith(cformEngagementNum,'"+clientNumber+"'))&$top=5000";
    //alert("testing " + RESTQuery);
    var call = $.ajax({
        url: _spPageContextInfo.webAbsoluteUrl + RESTQuery,
        type: "GET",
        dataType: "json",
        headers: {
            Accept: "application/json;odata=verbose"
        }
    });
    //alert("testing " + call);
    var testTable = $
    call.done(function (data,textStatus, jqXHR){
        var testTable = $('#example').dataTable({
            "bDestroy": true,
            "bProcessing": true,
            "aaData": data.d.results,
            "aoColumns": [
                { "mData": "cformEngagementNum" },
                { "mData": "cformClientName" },
                { "mData": "cformProjectName" },
                { "mData": "cformEngEMContact" },
                { "mData": "cformClientNumber", visible: false },
                 ]
          });
          //testTable.on('click', function (e, settings, json) {
              alert(json);
         // });
    });
    call.fail(function (jqXHR,textStatus,errorThrown){
        alert("Error retrieving Tasks: " + jqXHR.responseText);
    });
}
 function Init(){
     //Initialization function. Tells SF which Query String Variable
     //has the ID of the form, and the name of the list to read data from
     $("#clientEngRequest").StratusFormsInitialize({
        queryStringVar: "formID",
        listName: "clientEngRequest",
        completefunc: function() { 
            $('#city').select2({tags:true});
            $('#state').select2({tags:true});
            $('#GMContact').select2({tags:true});
            $('#Office').select2({tags:true});
            $('#EngManager').select2({tags:true});
            $('#BDMManager').select2({tags:true});
            $('#BU').select2({tags:true});
            $('#CSMIssued').select2({tags:true});   
       }
     });
    $("div.ms-cui-tabContainer").hide();
}
function SubmitForm()
{
    //When the form is submitted store it to the specified list
    //also pasas in the x and y offset of error messages for elements
    //this allows you to change their location in reference to the form field
    $("#clientEngRequest").StratusFormsSubmit({
        listName: "clientEngRequest",
        errorOffsetTop: 0,
        errorOffsetLeft: 5,
        completefunc: function(id) { 
            alert("Save was successful. ID = " + id);
            window.location = window.location.pathname + "?formID=" + id; 
        }
     });
}
This discussion has been closed.