Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7527355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:05:11+00:00 2026-05-30T04:05:11+00:00

I would like to ask: I have a array with predefined order. var order=new

  • 0

I would like to ask:
I have a array with predefined order.

var order=new Array(); 
order[0]="Tesco";       
order[1]="Interspar";
order[2]="Penny Market";

etc..

And i need to write out items in predefined order.

I can write out item in order as is, but i cannot writeout in predefined order.

$.each(mapdata, function(index, value) {

    //IF IS CHAIN IN ARRAY obchody, exit LOOP , ELSE ADD CHAIN TO LIST  
    if (jQuery.inArray(value.retezecnazev, obchody) === -1) {

        obchody.push(value.retezecnazev);

        countOfProducts++;

        //CHANGE DATE FORMAT 
        var choppedDate = value.platido.split('-');

        var newDate = choppedDate[2] + "." + choppedDate[1] + "." + choppedDate[0];

        $("ul").append("<li data-icon=\"false\"><a data-ajax=\"false\"  href=\"show_flyer.html?id=" +
                value.id +
                "&countOfPages=" +
                value.strany +
                "&nameOfChain=" +
                value.retezecnazev +
                "  \"><img  style=\"margin-top:10px;\" src=\" " + value.img + " \"/><h3 style=\"font-size:1.5em;\">" +
                value.retezecnazev +
                "</h3><div class=\"pageCount\" style=\"font-size:0.7em;\">" +
                value.strany +
                " Stran</div><div style=\"font-size:0.7em;\" class=\"pageCount\">Platnost do: " +
                newDate +
                " </div></a> </li>");
    }
});

Is anybody who can help me and know how it solve?

Thanks very much for any advice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:05:12+00:00Added an answer on May 30, 2026 at 4:05 am

    Do you want to sort the array the very first time it’s written and then leave it as is, or do you want to allow the user to sort the array after it’s already on the page? If you don’t care about sorting the array after the page has loaded, then apply a sort immediately before you loop over mapData:

    http://www.w3schools.com/jsref/jsref_sort.asp

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to ask for a reccomended solution for this: We have a
I have already posted something similar here but I would like to ask the
Greetings, I would like to ask if creating Singleton to have only one active
I would like to ask about php's preg_match_all. suppose we have the sample string
I would like to ask a question about a new and large scale web
I am new to Numpy and I would like to ask you how to
I have a few questions I would like to ask about string literals and
I would like ask if there's a way to download an android layout from
What I would like ask is best illustrated by an example, so bear with
I would like to ask for some simple examples showing the uses of <div>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.