Giter VIP home page Giter VIP logo

Comments (7)

kblairwhite avatar kblairwhite commented on July 4, 2024

I would do the same thing we do just below that for the transect:
example:
var modal = Alloy.createController("modal", {siteID:e.rowData.siteID}).getView();

  • pass the site id, then call the database for your desired information.
    "transects.js" does almost the exact same thing.

from capstone.

NickGulajec avatar NickGulajec commented on July 4, 2024

I can get the value over to modal.js with:

var args = arguments[0];
function editBtnClick(){alert(args.siteID);}

but is there any way to call args.siteID from modal.xml? I'm just using siteID as example, would probably want to display parkName.

from capstone.

kblairwhite avatar kblairwhite commented on July 4, 2024

I don't think so because parkName is only visible in the loop inside the index.js.

This would work in modal.js:

//retrieve siteID
var args = arguments[0];
var siteID = args.siteID;

//Open Database
var db = Ti.Database.open('ltemaDB');

//Query - Retrieve existing sites from database
var row = db.execute('SELECT park_name ' +
'FROM park p, site_survey s ' +
'WHERE p.park_id = s.park_id ' +
'AND s.site_id = ?', siteID);

var parkName = row.fieldByName('park_name');
db.close();

from capstone.

kblairwhite avatar kblairwhite commented on July 4, 2024

Or...
The only other thing you could do is pass parkName to the row when it is created in index.js? Don't know whats a better way?

from capstone.

NickGulajec avatar NickGulajec commented on July 4, 2024

Figured it out.
Instead of creating a label tag in the .xml and trying to assign it a dynamic property,
create the the label in the .js like so:

var args = arguments[0];

var label = Ti.UI.createLabel({ text: args.parkName});

$.modalWin.add(label);

from capstone.

kblairwhite avatar kblairwhite commented on July 4, 2024

I know this is closed but, I think I may have misinterpreted the question.
But you can use (in the .js file):
$.ID_of_label.text = "something";

from capstone.

NickGulajec avatar NickGulajec commented on July 4, 2024

That's perfect, thanks Blair.

from capstone.

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.