Page 1 of 1

get var insert in function

Posted: Sat Sep 05, 2015 4:28 pm
by Vinny B

Hello:

Code: Select all

I am unsure how to do this and I dont even know what to search for. I need to get the var grid = Apperyio('grid').text(); into liveEventArray[arrayVal].(grid) = gridOutput; were is says grid. 

Full code below provided by Yuri. It works if I replace(gris) with the name grid_1 but I need to change grid_1 to the value of grid which could be grid_2 or grid_3

var grid = Apperyio('grid').text();

var liveEventArray = Apperyio.storage.fireCalendarArray.get();
//here you can alter your array in way you need. Like:

liveEventArray[arrayVal].val(grid) = gridOutput;

Apperyio.storage.fireCalendarArray.set(liveEventArray);


get var insert in function

Posted: Sun Sep 06, 2015 2:27 am
by Vinny B

Anybody


get var insert in function

Posted: Sun Sep 06, 2015 3:18 am
by Illya Stepanov

Hi Vinny -

I'm not sure what is actually the question and what is not working for you?


get var insert in function

Posted: Sun Sep 06, 2015 3:39 am
by Vinny B

I understand.. I dont know what its called so its hard for me to explain. I will attach some photos.

I need to get the value of the var grid into the code. I highlighted the var and the place in the code i need it to appear.

Image

Here is the complete code
// We are taking the text from an input box
var gridValue = 'ABCD';
var dropDown = '1232';
var gridOutput = dropDown + ' ' + gridValue;
var arrayVal = '1';
var grid = 'grid_XYZ';

var liveEventArray = Apperyio.storage.fireCalendarArray.get();
//here you can alter your array in way you need. Like:

liveEventArray[arrayVal].grid = gridOutput;

I need the above code to dynamiacly from the var to look like the below code.
The problem is I cant fer the var grid = 'grid_XYZ'; into the above code.

//liveEventArray[0].grid_XYZ = ABCD 1232

Apperyio.storage.fireCalendarArray.set(liveEventArray);

Sorry its hard for me to explain.
Thank you


get var insert in function

Posted: Sun Sep 06, 2015 12:13 pm
by Vinny B

how to get the value of grid to be passed into the line of code "liveEventArray[arrayVal].grid = gridOutput; "
were it says grid?
.grid does not call the value of grid its defined.


get var insert in function

Posted: Fri Sep 11, 2015 8:23 pm
by Serhii Kulibaba

Hello,

Could you show us model structure of the fireCalendarArray variable? Does it contain "grid" element? What exactly doesn't work?