ClearInvalidSelections Issue

Forums SPJS-Lookup ClearInvalidSelections Issue

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 8 months ago.

  • Author
    Posts
  • #15772

    Kasey
    Participant

    I am using your new version of SPJS-Lookup and am receiving an error on my edit forms of “The rule ‘Org Change’ tried to invoke the function: “orgChange”. Error: TypeError: Cannot read property ‘append’ of undefined. It works fine in the new form as it isn’t trying to append the previous value to the lookup list of values. Any thoughts?

    Custom JS:
    var lookupOne = {
    “fieldToConvertToDropdown”:[“FieldInternalName”],
    “optTextFieldInternalName”:”Title”,
    “listName”:”ListName”,
    “listBaseUrl”:”/Sites/SiteName”,
    “sortFieldName”:”Title”,
    “clearInvalidSelections”:false,
    “filterObj”:{
    “on”:true,
    “folder”:””,
    “CAML”:null,
    “fin”:”Org”,
    “isLookup”:false,
    “operator”:”Eq”,
    “filterVal”:””
    },
    “dropDownDefaultvalue”:””,
    “addYouOwnValue”:{
    “on”:false,
    “linkText”:”Write your own value”
    },
    “addToExternalList”:{
    “on”:false,
    “customFunction”:null,
    “linkText”:”Add new item”,
    “saveNewItemText”:”Save new item”
    },
    “debug”:false
    };

    function orgChange(){
    lookupOne.filterObj.filterVal = getFieldValue(“FieldInternalName2”);
    spjs.lookup.init(lookupDecisionForum);
    }

  • #15802

    Alexander Bautz
    Keymaster

    I have found the bug and will post a new version soon. In the meantime you can change line 181 like this:

    spjs.$("#"+fin+"_spjs_lookup").append("<option value='0'>"+cVal+"</option>");

    PS: In your example you create an object called “lookupOne”, but calls the function with “lookupDecisionForum” – I guess this is just a typo in the code example.

    Alexander

You must be logged in to reply to this topic.