Giter Club home page Giter Club logo

Comments (11)

Swatto avatar Swatto commented on August 17, 2024

Simply add update_table_data after updating your instance variable in the callback.
And you should initialize your instance var before the callback.

def on_load
  @games_list = []

  BW::HTTP.get("http://remoteserver.com/api.json") do |response|
    @games_list = massage_data(response)
    update_table_data
  end

  @hometable ||= [
    {
      title: "List of games",
      cells: @games_list
    },{
      title: "Settings",
      cells:[
        {
          title: "Account", action: :account_settings
        },{
          title: "Notification", action: :notification_settings  
        }
      ]
    }
  ]
end

from promotion.

alagu avatar alagu commented on August 17, 2024

That worked, thanks @Swatto!

from promotion.

jamonholmgren avatar jamonholmgren commented on August 17, 2024

Are you actually getting your @games_list cells from the server? That's an interesting way to do it.

from promotion.

alagu avatar alagu commented on August 17, 2024

Yes. I'm getting it from a server. 

Sent from Mobile

On Mon, May 27, 2013 at 11:59 AM, Jamon Holmgren [email protected]
wrote:

Are you actually getting your @games_list cells from the server? That's an interesting way to do it.

Reply to this email directly or view it on GitHub:
#94 (comment)

from promotion.

jamonholmgren avatar jamonholmgren commented on August 17, 2024

Dynamically programming your app from a server. Sounds vaguely dangerous. :)

from promotion.

alagu avatar alagu commented on August 17, 2024

I show a loading icon when there is a request in progress. I'm also planning to cache it. Can you explain how it could be dangerous?

from promotion.

jamonholmgren avatar jamonholmgren commented on August 17, 2024

We allow setting any cell attribute in table_data, so if someone intercepted the request and returned something malicious, it would run. I can't think of anything offhand (hence the "vaguely") but it would be possible to change how your app works pretty easily.

from promotion.

alagu avatar alagu commented on August 17, 2024

Got it. I'm massaging data that comes from the server with few filters. So I guess it should be safe.

from promotion.

jamonholmgren avatar jamonholmgren commented on August 17, 2024

That's a good idea. What kind of app are you working on, if I might ask?

from promotion.

alagu avatar alagu commented on August 17, 2024

I'm trying to build a reader to read algorithm problems in Topcoder, for me to read problems, scribble possible solutions(paint), see best submitted solutions. Variable names in above snippets are not real :)

from promotion.

jamonholmgren avatar jamonholmgren commented on August 17, 2024

Nice!

from promotion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.