locked
need some help with the accordion RRS feed

  • Question

  • User-2051535749 posted

    I'm running into an issue with showing all of the associated data in my accordion, meaning that, not everything is appearing in the expanded view for the header of the accordion

    here is my code:

    	$.each(data.d.results, function(index, j) {
          			header = "<div id='Cars'>"
    			if(title != preTitle)
    			{
    						
    				 html += "<h3><a href='#'>" + Title + "</a></h3><div>" 
          		    		 html += "<a href='" + url + Code +"'>" +  CarModes + "</a></div>"
          		    		 preTitle = title;   
          		      }				
    		});  
          			$("#CarSales").append(header +  output + "</div>" ); 

    what happening is that, the data is showing as:

    BMW:

        325i

    Mercedes

         C280

    Chevy

        Silverado 2500

    and I should be seeing the data as

    BMW:

        325i

        525

        M3

        M5

    Mercedes

         C280

          s550

          AMG c43

    Chevy

        Silverado 2500

       Silverado 3500

       Silverado 1500

       Camero

    how can I get all of the models to appear under the manufacture and not just the first model returned?

    Thursday, December 1, 2016 4:03 PM

All replies

  • User177399542 posted

    Hi

         Check this simple solution: http://www.codingfusion.com/Post/Dynamic-Jquery-Accordion-using-Repeater-in-Asp-Ne

    Friday, December 2, 2016 4:14 AM
  • User-707554951 posted

    Hi SharePointGuy,

    For your problem, I suggest you could use F12 develop tools, in Debug tab, you could debug your code

    If you still have problem, would please provide more code about how you get data, using ajax?

    If that, what is the code, what is your webmehtod code.

    Please provide us with more code as  possible, so that we could restore you problem and find solution.

    Best regards

    Cathy

    Friday, December 2, 2016 8:15 AM
  • User-2051535749 posted

    I've done that and there are no errors, I'm able to get the data out and group it correctly, it's when I add the accordion tags around the code, is when the grouping fails.

    Friday, December 2, 2016 12:38 PM
  • User-707554951 posted

    Hi SharePointGuy,

    Would you please provide use with more code about this? So that I could restore your problem and find reason.

    Best Regards

    Cathy

    Thursday, December 29, 2016 6:11 AM