Skip to main content

Need to create a alert on save button  onclick the function is 

 

function doInitFiltering(filters, advFilters){     var target = 'Call_Log__c';     var event = 'load';     initFilterWidget(event, target, filters, advFilters);              $('.search_btn').button();     $('.search_btn').bind("click", function(event){         startSavingFade();                       re = /\|/gi;         var events = $("sf_filters").sfFilters("Serialize").replace(re, "___");;         var advanced = $("sf_filters").sfFilters("AdvancedFilter");         var columns = getColumnsList(document.getElementById('__selected'));

 

**Need help here 

// here want to add something like if  var columns does not contain the "xyz" then alert('please add "xyz" as column option)

 

else perform next three functions {         saveColumnsFilters(columns, events, advanced);         event.preventDefault();         event.stopImmediatePropagation(); }     }); }

 

#Development #Visualforce Pages  

3 Antworten
  1. 25. Juli 2021, 07:10

    Hi Pooja,

     

    We do not have control over the OK button on alert JavaScript method. If you want a customized button action, use the slds alert blueprint. Control the visibility of this component from js with the help of css. For example,

    if (!columns.includes('xyx'){ // remove slds-hide class from the alert to show it }

    // In the alert, add click event handler for close button

    onclick="//select the alert container and add slds-hide"

0/9000