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

  • Home
  • SEARCH
  • 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 7964105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:47:59+00:00 2026-06-04T05:47:59+00:00

In my controller, I want to get a random record from the localstorage and

  • 0

In my controller, I want to get a random record from the localstorage and display in the view, how can I do that?

In my config I have:

stores: ['Items']

In my function I have :

var mystore = (this.getStores())[0];  
var index = this.getRandomInt(0, mystore.totalCount() -1);
var nextItem = mystore.getAt(index);

but it’s stuck at the first line

Maybe there is an easier way?

  • 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-06-04T05:48:01+00:00Added an answer on June 4, 2026 at 5:48 am

    Since your store is called ‘Items’ i would:

    var mystore = Ext.getStore('Items');
    

    is the most reliable way to get the instance of the store.

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

Sidebar

Related Questions

I want to call a controller function from a view. Is that possible in
i want get string from one view controller to another view controller i done
I have a model that uses acts_as_url and in my controller I want to
Let's say that if I read from www.example.com/number, I get a random number. In
I have data in my controller that is being received from another rails app
I want to get the value of a single variable from my Controller class
i want from url like this: example.com/?module=index&controller=index&action=hello to get the values by $_GET[] and
I want to get value of TempData into View Controller [NonAction] public ActionResult RedirectToMessagePage(string
For the GET function in my controller I want to require that a name
is It possible get a shuffle/random of a collection from action in controller. def

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.