Christopher Lester

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Javascript error in spjs-vLookup_frontend #30680
    Christopher Lester
    Participant

    Alexander,

    I’m running the very latest version as stated above, 4.4.5.0. I cannot be sure if it’s a SharePoint 2010 thing only but it creates a row for list attachments without the “fieldInternalName”. I applied a pretty benign fix that says only look for “fieldInternalName” starting with “vLookup” where there exists an attribute called “fieldInternalName”.

    I’m hoping that you apply the patch even if you can’t reproduce it (based on the logic above) because trying to fix the minimised file is difficult and I don’t want my code to blow up if the library is updated in future. I’m holding off fixing the minimised file until you confirm a fix or not.

    Chris.

    in reply to: Javascript error in spjs-vLookup_frontend #30659
    Christopher Lester
    Participant

    Alexander,

    Firstly, thanks for explaining the jquery setup and assuring me I’ve done the right thing there.

    I wasn’t aware of that pretty print trick. Using that I was able to isolate the issue.

    It related to the creation of an attachments row for list attachments. Even though I turned off attachments to my lists, for some reason this row gets created in the form, being part of ‘spjs_formtable_row’ but not having a ‘fieldinternalname’ attribute, and it’s this which causes the error.

    The code:

    
    
    jQspjs(".spjs_formtable_row").each(function(i, a) {
        var b = jQspjs(a).attr("fieldinternalname");
        if (b.indexOf('vLookup') === 0) {
        ...

    The error line was the third line above. I was able to fix the code by inserting
    a check at the start of the if condition for the fieldinternalname attribute so that it is now

    if (a.hasAttribute('fieldinternalname') && b.indexOf('vLookup') === 0) {

    Thanks for your prompt reply.

Viewing 2 posts - 1 through 2 (of 2 total)