enhancements to hide manual refresh button and show a delete item button

Forums vLooup for SharePoint enhancements to hide manual refresh button and show a delete item button

Tagged: 

Viewing 1 reply thread
  • Author
    Posts
    • #33056
      Daniel Schauer
      Participant

      I have a javascript function that checks for specific text in the [Note to Self] field in my vLookup configuration. I’d love it if you could add this to the vlookup configuration GUI.

      my Javascript code, called by vLookupIsLoadedCallback

      
      
      var config = spjs.vLookup.data.blob[fin];
      try{config.noteToSelf = decodeURIComponent(config.noteToSelf);}catch(err){}
      if ( config.noteToSelf.indexOf("no manual refresh") >= 0 ){
          jQspjs("[id='vLookupManualRefresh_"+ fin +"']").hide()
      }
      if ( config.noteToSelf.indexOf("delete button") >= 0 ){
          showvLookupRowDeleteButton(fin);
      }
      
      function showvLookupRowDeleteButton(fin){
          jQspjs("#vLookupTablePlaceholder_"+fin+" TABLE.vLookupTable > TBODY > TR.vLookupTableRow").each(function(i,elm){
              var event = {};
              jQspjs(elm).find("TD.childTableCell").each(function(iTD, elmTD){
                  event[elmTD.className.replace("childTableCell","").replace(fin+"_","").trim()] = jQspjs(elmTD).text()
              });
              if ( jQspjs(tableRow).find("TD.childTableCell.vLookupBtn > TABLE > TBODY > TR > TD").length > 0 ) {
                  jQspjs(tableRow).find("TD.childTableCell.vLookupBtn > TABLE > TBODY > TR > TD").eq(0).after("<TD valign='top' class='vLookupDeleteBtn_"+ fin +"'><a title='Delete item' href='javascript:spjs.utility.deleteItem({\"listName\":\""+ listName +"\",\"id\":"+ personRecord.ID +"}); spjs.vLookup.refresh(\"vLookupAllPersons\");'><i class='fa fa-times red' style='"+ jsWorkflow.settings.deleteChildButtonStyles +"'></i></a></TD>");
              }
              else {
                  jQspjs(tableRow).find("TD.childTableCell.vLookupBtn").append('<table cellpadding="0" cellspacing="0"><tbody><tr></tr></tbody></table>');
                  jQspjs(tableRow).find("TD.childTableCell.vLookupBtn > TABLE > TBODY > TR").append("<TD valign='top' class='vLookupDeleteBtn_"+ fin +"'><a title='Delete item' href='javascript:spjs.utility.deleteItem({\"listName\":\""+ listName +"\",\"id\":"+ personRecord.ID +"}); spjs.vLookup.refresh(\"vLookupAllPersons\");'><i class='fa fa-times red' style='"+ jsWorkflow.settings.deleteChildButtonStyles +"'></i></a></TD>");
              }
          });
      }

      My suggested HTML for the GUI and a screenshot is attached

    • #33059
      Alexander Bautz
      Keymaster

      I’ll see if I might be able to add this in a later version, but if you want to hide the refresh button you can just drop this in your Custom CSS:

      #vLookupManualRefresh_vLookupTasks{
          display:none;
      }

      Replace vLookupTasks with the name of your vLookup column.

      Regarding a delete button you can add it using some custom js as described in this post: https://spjsblog.com/forums/topic/delete-button-on-child-item-with-refresh-for-document-library/#post-10072

      Alexander

Viewing 1 reply thread
  • You must be logged in to reply to this topic.