Christopher Holubarz

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • in reply to: vLookup Group Item Count next to Group #31604

    Hi Alexander,

    Of course, I’ve combined it with a search field that hides the not matching items and also corrects the count to show the number of items found in the corresponding group.

    The picture Brosch1 shows the form ready state where the items have been counted.
    The picture Brosch2 shows the filled out search box and groups with 0 count are hidden as well.

    The function for counting the items in the groups is shown below:

    
    
    function countTotals()
    {
        var groups = $('.vLookupGroup');
        $(groups).each(function(){
            var count = $(this).find('tr.vLookupTableRow:not(.hidden)').length;
            var curcount = $(this).siblings(".vLookupGroupHeader").find('.broschcount');
            if(curcount.length > 0) 
            {
                curcount.text(" ("+count+")");
            }
            else 
            {
                $(this).siblings(".vLookupGroupHeader").append("<span class='broschcount'> ("+count+")</span>");
            }
            
            if(count === 0) 
            {
                $(this).parent().addClass('hidden');
            } 
            else 
            {
                $(this).parent().removeClass("hidden");
            }
        });
    }

    When the vLookup is loaded, I’m counting the totals in the groups initially:

    
    
    function vLookupIsLoadedCallback(fin){
        if(fin === "vLookup_Broschueren")
        {
            var groupsloaded = setInterval(function() {
                var groups = $('.vLookupGroup');
                if(groups.length > 0) 
                {
                    clearInterval(groupsloaded);
                    countTotals();
                }
            },1000);
        }
    }

    And when I’m searching for items I’m again refreshing the totals count:

    
    
    function highlightMatches(elm, fin) {
        
         var sVal = jQuery(elm).val(),
            container = jQuery("#vLookup_" + fin + "_" + spjs.dffs.data.thisItemID).find(".vLookupTable");
        container.find("tr.vLookupTableRow").removeClass("hidden");
        if (sVal !== "") {
            container.find("tr.vLookupTableRow").each(function(i, tr) {
                if (jQuery(tr).text().toLowerCase().match(sVal.toLowerCase()) !== null) {
                    //jQuery(tr).addClass("highlightSearchMatchInvLookup");
                }else{
                    jQuery(tr).addClass("hidden");
                }
            });
        }
        countTotals();
    }

    Hope this will help someone else too 🙂

    BR,
    Chris

    in reply to: vLookup Group Item Count next to Group #31558

    Hi Alexander,

    I’ve figured out a solution myself, you don’t need to take care of this.

    Thank you and BR,
    Chris

    in reply to: vLookup Search 2.0 #31413

    Hi Alexander,

    Thank you very much for the perfect solution, it works very well 🙂

    BR,
    Chris

    in reply to: Dynamically hide vLookup column #30763

    Hi Alexander,

    Thank you very much for your help, this worked like a charm 🙂

    Thank you and BR,
    Chris

    in reply to: Dynamically hide vLookup column #30759

    Hi Alexander,

    Here is the code:

    
    
    function returnItemPrice(a, item)
    {
        var id = item.get_item("ID");
        debugger;
        var whr = getFieldValue('W_x00e4_hrung');
        var cc = new SP.ClientContext.get_current();
    	var list = cc.get_web().get_lists().getByTitle('Pakete');
    	var oItem = list.getItemById(id);
    	cc.load(oItem);
    	cc.executeQueryAsync(
    	    function(sender, args) 
    	    {
    	        switch(whr) 
    	        {
    	            case 'EUR': console.log("Returning '"+oItem.get_item('EUR').toString()+"'"); return oItem.get_item('EUR').toString();
    	            case 'CHF': console.log("Returning '"+oItem.get_item('CHF').toString()+"'"); return oItem.get_item('CHF').toString();
    	            case 'USD': console.log("Returning '"+oItem.get_item('USD').toString()+"'"); return oItem.get_item('USD').toString();
    	        }
    	    },
    	    function(sender, args) 
    	    {
    	        console.log("Error getting price");
    	    }
        );
    }

    Thank you in advance and BR,
    Chris

    in reply to: Dynamically hide vLookup column #30741

    Hi Alexander,

    Thank you for your feedback. Actually I have all 3 prices for each item, but returning the correct one to a [CustomField] doesn’t seem to work, although I get no errors in the code. (see attached Screenshots)

    BR,
    Chris

    Hi,

    Thank you, I fixed the problem with placing a content editor and referencing the installer v2.
    Works like a charm now.

    BR,
    Chris

    in reply to: Order by Date Descending not working #27879

    Hi Alexander,

    I can confirm that the sorty by Date works now with the new version.

    Thank you very much 🙂

    BR,
    Chris

    in reply to: Order by Date Descending not working #27865

    Hi Alexander,

    Alright Thank you very much, I will try IT with the attached Version then and will appky the fixed Version next week.

    Thank you very much and have a nice weekend.

    BR,
    Chris

    in reply to: Order by Date Descending not working #27859

    Hi Alexander,

    str = undefined is the value of str. (see attached screenshot)

    Do I have to pass a parameter in the parse function ?

    Thank you very much and BR,
    Chris

    in reply to: Order by Date Descending not working #27847

    Hi Alexander,

    Unfortunately it is still not working.

    I’ve added the function as mentioned in the user manual as you can see in the screenshot.

    However, I get an error in the console and the spinner turns forever and returns no results (2nd Screenshot)

    Am I missing something here ?

    Thank you very much and BR,

    Chris

    in reply to: Order by Date Descending not working #27845

    Hi Alexander,

    Thank you for the information, I will try the new version.

    Thank you very much and BR,
    Chris

    in reply to: Order by Date Descending not working #27686

    Hi Alexander,

    Thank you for your feedback, I’ll wait for the next version 🙂

    BR,
    Chris

    in reply to: vLookup Multiline Text Column with "read more" #27150

    Hi Alexander,

    Thank you very much this worked like a charm.

    BR,
    Chris

    in reply to: Alternating row style and pring #23357

    Hi Alexander,

    Thank you very much, that worked like a charm.

    BR,
    Chris

Viewing 15 posts - 1 through 15 (of 27 total)