task

4800-v-003-002

selections - display drivers name

[previously]

  1. ] PAGE selections
    1. *] GOAL - display "drivers names" correctly with driver name
    2. ] currently pulling teamID's from the array "selections" in route/index.js
    3. x] have to pass 'selections' into the 'view' from  
    4. x] have to pass 'drivers' into view

[currently]

  1. [2015-06-06] NEW task IN outline
    1. x] ADD  manually - team_id field  - ] to all drivers entries in drivers.json
    2. ] CREATE - "lookup" function - driver by team id -{ return indexOf.drivers(teamID) } the index of the driver in the array of driver objects, which would enable us to pull the drivers data
    3. x] CREATE - selections.js // model - seperate file for MODEL view
    4. x] add function 'lookupDriver' to  
    5. ?] add requires = ./drivers.json
    6. ] PRB - PG inline script does NOT have access to the passed in values ] - the view can access to the data that "routes/.." passed into it ( ex drivers)  
    7. *] inline script can call function in "linked" script, ex inline function callLinked(drivers){//doStuff}
    8. x] 
    9. x] TRY = pass string into function in .js file works
  2. [00:00] NEW task IN PAGE drivers.json
    1. ] # # ADD  manually - team_id field  - to all drivers entries in drivers.json
  3. [00:00] NEW task IN PAGE routes/index
    1. ] # # - CREATE - "lookup" function - driver by team id -
    2. ] { return indexOf.drivers(teamID) }
    3. ] the index of the driver in the array of driver objects, which would enable us to pull the drivers data
  4. > [00:00] NEW task IN PAGE selections.js
    1. ] # # CREATE PAGE- selections.js // model - a seperate file for the MODEL || viewModel (data, we need to construct the view, METHODS to operate on data )
    2. x] link the script in the view -
    3. *] NOT using b/c PRB cant seem to access the data that is passed into the view from the scripts in this file
    4. ?] add requires = ./drivers.json
  5. [00:00] NEW task IN PAGE selections.js
    1. ] # # - PRB - can't access data
    2. ] view has access to the data that "routes/selections" passed into it ( ex drivers) BUT ] PRB -
    3. ] PG inline script does NOT have access to the passed in values 
    4. *] inline script can call "linked" script, ex inline function callLinked(drivers){//doStuff}
    5. x] TRY = pass string into function in .js file works
  6. *[00:00] NEW task IN PAGE routes/index.js
    1. ] # # - WORKAROUND - x] use route/index - app.get(/selections) - build data for page in this file, then pass data into the view - this works fine but this file would become a huge messy beast after some time
  7. [00:00] NEW task IN PAGE routes/index.js
    1. ] # # - ADD property to teams[] object, - x] added field 'driverIndex', use this to store a reference to the drivers information in the
    2. ?] WHAT IF - drivers table changes, aka someone deletes a driver record
  8. [00:00] NEW task IN PAGE routes/index.js
    1. ] # # - UPDATE lookup function - x] use code to find "key" "value" in an arrary of javascript objects
    2. x] findIndexOf(arraryToSearch, "key", "value")
      1. ] where key is is field you want to search on, value is the value you want to match
      2. ] EXAMPLE = findIndexOf(drivers,"teamID", "48") 
    3. ] drivers[teams[index].driverIndex].name
    4. ] REF = # 4562 - javascript-how-to-lookup-index-of-object
  9. [2015-06-07][00:00] PUBLISH
    1. x] route/index selections x] selections.jade *] javascript/selections.js, x] drivers.json

[next]

  1. [2015-06-07]i] # 5246 - 4800-v-003-002-selections - UPDATE display drivers name
    1. ] TEST - requires drivers, different paths, no change,
    2. ] HAVE = selections.drivers[5] - contains teamID
    3. ] HAVE = teams [id:17 driverID:223], NEED-  lookup ] get driverID, ] lookup driverName in
    4. >] HAVE*= drivers[id: ,name: ,teamID - NEED - lookup
      1. ] do in route?controller - pass into view
      2. ] inline script in view
      3. ] linked script in view (PRB passing data to )
  2. ]  drivers[teams[index].driverID].name

 [format]

  1. ] PAGE route/index
    1. ] DEFINE object
    2. ] CREATE function - buildMenuMain()
    3. ] PASS object 'menuMain' into /view/*
  2. ] UPDATE PAGE view/index
    1. ]
  3. ] TEST 4800-v-003-selections-display-drivers-name
    1. ]

 

 

Details Photos Edit more

Details

ID: 5246

NAME: 4800-v-003-002-selections-display-drivers

DESCRIPTION: ] UPDATE PAGE selections - display drivers data(name, ...) for "my selections",

START DATE TIME: 2015-06-06 11:38:22

EST DURATION: 01:00:00

END DATE TIME: 2015-06-06 12:38:22

STATUS: Completed

PRIORITY: -5

OWNER ID: 75

Content Photos Edit more

photos

photos for this task

actions

Agenda Email task SMS task Priorities