Text bind:value is not working according to Select bindings - data-binding

I need to input the value which i got it from selected option. If I select Tokyo, I need to input the code 1850147(CityCode of Tokyo) via bind:value. But my code didn't work that way. Help me fix this..
<script>
let cities = [
{
CityCode: "1248991",
CityName: "Colombo",
Temp: "33.0",
Status: "Clouds",
},
{
CityCode: "1850147",
CityName: "Tokyo",
Temp: "8.6",
Status: "Clear",
},
{
CityCode: "2644210",
CityName: "Liverpool",
Temp: "16.5",
Status: "Rain",
},
{
CityCode: "2988507",
CityName: "Paris",
Temp: "22.4",
Status: "Clear",
},
{
CityCode: "2147714",
CityName: "Sydney",
Temp: "27.3",
Status: "Rain",
},
{
CityCode: "4930956",
CityName: "Boston",
Temp: "4.2",
Status: "Mist",
},
{
CityCode: "1796236",
CityName: "Shanghai",
Temp: "10.1",
Status: "Clouds",
},
{
CityCode: "3143244",
CityName: "Oslo",
Temp: "-3.9",
Status: "Clear",
},
];
let selected;
function handleSubmit() {
alert(
`Chosen city ${selected.CityCode}`
);
}
</script>
<h2>Choose City from here</h2>
<form on:submit|preventDefault={handleSubmit}>
<select bind:value={selected}>
{#each cities as city}
<option value={city}>
{city.CityName}
</option>
{/each}
</select>
<button type="submit"> Submit </button>
</form>
<input type="text" bind:value={selected.CityCode}>
When I select an option and hit the submit button, It was correctly shown on alert but input type has not been changed according to what I selected previously... What's wrong with my code?

I can't quite tell what you're trying to accomplish because binding a value in two different places will become hard to work with. Binding means two-way updates. You're binding to selected, which is a variable (great!), but then you are also binding to selected.CityCode which is not a variable. If you want to just pass the value, you can do
<input type="text" value={selected.CityCode}>
If you still want the input to be bound, you can pass the value as you submit, like so:
<script>
let cities = [
{
CityCode: "1248991",
CityName: "Colombo",
Temp: "33.0",
Status: "Clouds",
},
{
CityCode: "1850147",
CityName: "Tokyo",
Temp: "8.6",
Status: "Clear",
},
{
CityCode: "2644210",
CityName: "Liverpool",
Temp: "16.5",
Status: "Rain",
},
{
CityCode: "2988507",
CityName: "Paris",
Temp: "22.4",
Status: "Clear",
},
{
CityCode: "2147714",
CityName: "Sydney",
Temp: "27.3",
Status: "Rain",
},
{
CityCode: "4930956",
CityName: "Boston",
Temp: "4.2",
Status: "Mist",
},
{
CityCode: "1796236",
CityName: "Shanghai",
Temp: "10.1",
Status: "Clouds",
},
{
CityCode: "3143244",
CityName: "Oslo",
Temp: "-3.9",
Status: "Clear",
},
];
let selected;
let input;
function handleSubmit() {
alert(`Chosen city ${selected.CityCode}`);
input = selected.CityCode;
}
</script>
<h2>Choose City from here</h2>
<form on:submit|preventDefault={handleSubmit}>
<select bind:value={selected}>
{#each cities as city}
<option value={city}>
{city.CityName}
</option>
{/each}
</select>
<button type="submit"> Submit </button>
</form>
<input type="text" bind:value={input}>

Related

GTM create custom array out of datalayer

i have to get all sku's out of a data layer in gtm:
DataLayer looks like
{
pageName: "cart",
cart_total: "33.71",
ecommerce: {
items: [
{
item_name: "Product1",
item_id: "123",
},
{
item_name: "Product2",
item_id: "456",
},
{
item_name: "Product3",
item_id: "789",
}
]
},
customerId: "1234",
}
Output should be an array
item_id:"123,456,789"
I tried the following js:
function () {
item_id = []
for (i=0; i< ecommerce.items.length; i++) {
item_id.push(ecommerce.items.i.item_id);
}
return item_id;
}
You're saying that you want an array, but your example is a string. So, if you want a string, here:
DLObj.ecommerce.items.map(function(obj){return obj.item_id}).join()
If you want an array, just remove the join().
Here is the full code I used in testing:
var DLObj = {
pageName: "cart",
cart_total: "33.71",
ecommerce: {
items: [
{
item_name: "Product1",
item_id: "123",
},
{
item_name: "Product2",
item_id: "456",
},
{
item_name: "Product3",
item_id: "789",
}
]
},
customerId: "1234",
};
DLObj.ecommerce.items.map(function(obj){return obj.item_id}).join()
you can certainly use it as a custom javascript variable in GTM, just wrap it in an anonymous function and return the required value as GTM asks you to do. Similar to this:
function(){
return DLObj.ecommerce.items.map(function(obj){return obj.item_id}).join();
}

Add selected class to each clicked item in ngFor

Issue: With the current code, when i click an item, it correctly adds the "selected" class to the clicked item, but when i click another option, the "selected" class gets removed from it and gets added to the newly clicked item.
Wanted: I want to have the selected class added to all items which have been selected, my code is below, would appreciate any help:
My Html:
<form (ngSubmit)="onSubmit()">
<div *ngFor="let event of groupSelections; let i = index;" class="row">
<div class="col-12">
<div class="row">
<div *ngFor="let team of event?.Actors; first as isFirst" class="col-6">
<div class="row">
<div *ngIf="isFirst" class="col-6">
<div>
{{ team?.ActorName }}
</div>
</div>
<div class="col-6">
<div [className]="selectedValue == team?.Players ?'selected':''">
<select (change)="getSelections(team, event, $event, team?.Players)">
<option value="none" selected disabled hidden>SELECT</option>
<option value="" *ngFor="let player of team?.Players; let j = index">
{{ player?.Name }}
</option>
</select>
</div>
</div>
<div *ngIf="!isFirst" class="col-6">
<div>
{{ team?.ActorName }}
</div>
</div>
</div>
</div>
</div>
</div>
My function:
getSelections(actors, event, selectedOption, player): any {
const selections = [];
this.selectedTeam = actors;
this.selectedTeamPlayers = actors.Players;
this.gameEvent = event;
this.selectedValue = player;
selections.push({
EventId: this.gameEvent.EventId,
ActorId: this.selectedTeam.ActorId,
EventActorId: this.selectedTeam.EventActorId,
Score: 1,
Position: 1,
PlayerPosition: this.player.Position,
PlayerPoint: this.player.Point,
});
this.playerSelections = selections;
}
My Data:
groupSelections = [
{
"PromotionId": 5,
"Events": [
{
"Actors": [
{
"ActorId": 33,
"ActorName": "Italy",
"Players": [
{
"Name": " Mattia De Sciglio (D)",
"Position": "DEFENDER",
"Point": 5
},
{
"Name": "Bryan Cristante (M)",
"Position": "MIDFIELDER",
"Point": 3
}
]
},
{
"ActorId": 34,
"ActorName": "Turkey",
"Players": [
{
"Name": " Zeki Çelik (D)",
"Position": "DEFENDER",
"Point": 5
},
{
"Name": "Ozan Tufan (M)",
"Position": "MIDFIELDER",
"Point": 3
}
]
}
]
},
{
"Actors": [
{
"ActorId": 77,
"ActorName": "Slovakia",
"Players": [
{
"Name": "Mattia Perin (G)",
"Position": "GOALKEEPER",
"Point": 10
},
{
"Name": "Bryan Cristante (M)",
"Position": "MIDFIELDER",
"Point": 3
}
]
},
{
"ActorId": 78,
"ActorName": "Sweden",
"Players": [
{
"Name": " Zeki Çelik (D)",
"Position": "DEFENDER",
"Point": 5
},
{
"Name": "Ozan Tufan (M)",
"Position": "MIDFIELDER",
"Point": 3
}
]
}
]
}
]
}
Usually you should add a selected field to your Players object. Then you can set it to true and consider it when adding the additional class.
But let's do it with a simple array first.
TS file
selectedPlayers: Array<string> = [];
// check whether the players object is in the list
isSelectedPlayer(players: any): boolean {
return this.selectedPlayers.findIndex(element => element === players) > -1;
}
getSelections(actors, event, selectedOption, player): any {
const selections = [];
this.selectedTeam = actors;
this.selectedTeamPlayers = actors.Players;
this.gameEvent = event;
// add the selection to your list, if is not in it
if (this.selectedPlayers.findIndex(element => element === player) === -1) {
this.selectedPlayers.push(player);
}
selections.push({
EventId: this.gameEvent.EventId,
ActorId: this.selectedTeam.ActorId,
EventActorId: this.selectedTeam.EventActorId,
Score: 1,
Position: 1,
PlayerPosition: this.player.Position,
PlayerPoint: this.player.Point,
});
this.playerSelections = selections;
}
HTML
<div [className]="gameEvent == event && isSelectedPlayer(team?.Players) ? 'selected':''">

Redux action (fetch from db) not firing when useEffect() is called

I am trying to build an eCommerce website to learn Redux.
At the moment I am trying to fetch the categories when the component mounts. Since I am using functional components, I understood that this is achieved by calling the useEffect() method.
Also, I am using json-server as a REST Api.
I am quite sure I have managed to compose my enhancers to pass to the store (dev tools and thunk), created actions, reducers and all.
My problem is that the action doesn't fire when the component mounts.
N.B. before introducing the Middleware and therefore the fetch request, everything worked just fine. Also consider that the fetch request is successful.
Hereafter is the code involved.
'src/index.js'
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import { createStore, applyMiddleware, compose } from 'redux'
import { Provider } from 'react-redux'
import rootReducer from './reducers'
import thunk from 'redux-thunk'
const composedEnhancers = compose(applyMiddleware(thunk), window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__())
const store = createStore(
rootReducer, /* preloadedState, */
composedEnhancers
);
ReactDOM.render(
<Provider store={store}>
<React.StrictMode>
<App />
</React.StrictMode>
</Provider>,
document.getElementById('root')
);
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
serviceWorker.unregister();
the action type in 'actions/index.js':
export const FETCH_CATEGORIES = 'FETCH_CATEGORIES'
the action creator in 'actions/index.js':
export const fetchCategories = () => (dispatch) => {
fetch("http://localhost:7000/categories")
.then(response => response.json())
.then(categories => {
return {
type: FETCH_CATEGORIES,
payload: categories
}
})
}
'reducers/index.js'
import * as actions from './../actions'
const initState = {
categories: [],
currentCategory: 'any',
toggler: 'hidden'
}
const rootReducer = (state = initState, action) => {
switch (action.type) {
case actions.SELECT_CATEGORY:
return { ...state, currentCategory: action.payload.value }
case actions.FETCH_CATEGORIES:
return { ...state, categories: action.payload }
case actions.TOGGLE:
return { ...state, toggler: action.payload.toggler }
default:
return state
}
}
export default rootReducer
the 'Filter.js' component
import React, { useEffect } from 'react';
import { connect } from 'react-redux'
import { selectCategory, fetchCategories } from '../../../../actions'
const Filter = (props) => {
// const [minPrice, setMinPrice] = useState(0)
// const handleMinPrice = event => {
// setMinPrice(event.target.value)
// }
// const [maxPrice, setMaxPrice] = useState(0)
// const handleMaxPrice = event => {
// setMaxPrice(event.target.value)
// }
// const [department, setDepartment] = useState("select")
// const handleDepartment = event => {
// console.log(event.target.value)
// setDepartment(event.target.value)
// }
// console.log(props);
const handleChange = event => {
event.preventDefault()
props.selectCategory(event.target.value)
}
useEffect(() => {
props.fetchCategories()
})
return (
<div className="filter-form col-12">
<form id="filter-category">
<label htmlFor="category">Category</label>
<select className="col-12" id="category" name="category" size="5" value={props.currentCategory} onChange={(event) => handleChange(event)}>
{props.categories.map(category => <option key={category.value} value={category.value}>{category.name}</option>)}
</select>
</form>
{props.currentCategory !== 'any' && <form id="filter-department">
<label htmlFor="department">Department</label>
<select className="col-12" id="department" name="department" size="5" value='{department}' onChange='{handleDepartment}'>
<option value="select">--- Select ---</option>
<option value="desktop PCs">Desktop PCs</option>
<option value="laptops">Laptops</option>
<option value="gamepads">Gamepads</option>
<option value="headphones">Headphones</option>
<option value="microphones">Microphones</option>
<option value="keyboards">Keyboards</option>
</select>
</form>}
{/* <form id="filter-price">
<label htmlFor="minimum-price">Min. Price: {minPrice}£</label>
<input type="range" min="1" max="100" value={minPrice} className="slider col-xs-12" id="minimum-price" onChange={handleMinPrice} />
<label htmlFor="maximum-price">Max. Price: {maxPrice}£</label>
<input type="range" min="100" max="1000" value={maxPrice} className="slider col-xs-12" id="maximum-price" onChange={handleMaxPrice} />
</form> */}
</div>
);
}
const mapStateToProps = (state) => {
return {
categories: state.categories,
currentCategory: state.currentCategory
}
}
const mapDispatchToProps = (dispatch) => {
return {
selectCategory: (value) => {
dispatch(selectCategory(value))
},
fetchCategories: () => {
dispatch(fetchCategories())
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Filter);
Also, here is 'db.json'
{
"categories": [
{
"id": "1",
"value": "any",
"name": "--- Any ---",
"departments": []
},
{
"id": "2",
"value": "computers-and-accessories",
"name": "Computers and Accessories",
"departments": [
{
"id": "1",
"value": "desktop-pc",
"name": "Desktop PCs"
},
{
"id": "2",
"value": "laptops",
"name": "Laptops"
},
{
"id": "3",
"value": "keyboards",
"name": "Keyboards"
},
{
"id": "4",
"value": "headphones",
"name": "Headphones"
},
{
"id": "5",
"value": "mouses",
"name": "Mouses"
},
{
"id": "6",
"value": "gamepads",
"name": "Gamepads"
}
]
},
{
"id": "3",
"value": "fashion",
"name": "Fashion",
"departments": [
{
"id": "1",
"value": "dresses",
"name": "dresses"
},
{
"id": "2",
"value": "shoes",
"name": "Shoes"
},
{
"id": "3",
"value": "pants",
"name": "Pants"
},
{
"id": "4",
"value": "sunglasses",
"name": "Sunglasses"
},
{
"id": "5",
"value": "handbags",
"name": "Handbags"
},
{
"id": "6",
"value": "hats",
"name": "Hats"
}
]
},
{
"id": "4",
"value": "digital-music",
"name": "Digital Music",
"departments": [
{
"id": "1",
"value": "rock",
"name": "Rock"
},
{
"id": "2",
"value": "pop",
"name": "Pop"
},
{
"id": "3",
"value": "house-and-techno",
"name": "House and Techno"
},
{
"id": "4",
"value": "trap",
"name": "Trap"
},
{
"id": "5",
"value": "indie",
"name": "Indie"
},
{
"id": "6",
"value": "hip-hop",
"name": "Hip-Hop"
}
]
},
{
"id": "5",
"value": "house",
"name": "House",
"departments": [
{
"id": "1",
"value": "kitchen",
"name": "kitchen"
},
{
"id": "2",
"value": "garden",
"name": "Garden"
},
{
"id": "3",
"value": "bedroom",
"name": "Bedroom"
},
{
"id": "4",
"value": "bathroom",
"name": "Bathroom"
},
{
"id": "5",
"value": "livingroom",
"name": "Livingroom"
},
{
"id": "6",
"value": "cleaning",
"name": "Cleaning"
}
]
},
{
"id": "6",
"value": "grocery",
"name": "Grocery",
"departments": [
{
"id": "1",
"value": "vegetables",
"name": "Vegetables"
},
{
"id": "2",
"value": "pasta and rice",
"name": "Pasta and Rice"
},
{
"id": "3",
"value": "snacks",
"name": "Snacks"
},
{
"id": "4",
"value": "canned-food",
"name": "Canned Food"
},
{
"id": "5",
"value": "frozen",
"name": "Frozen"
},
{
"id": "6",
"value": "dairy",
"name": "Dairy"
}
]
}
]
}
What am I missing here?
Try dispatching like this in the action which will fire the reducer FETCH_CATEGORIES:
export const fetchCategories = () => (dispatch) => {
fetch("http://localhost:7000/categories")
.then(response => response.json())
.then(categories => {
// **Changes start here
dispatch ({
type: FETCH_CATEGORIES,
payload: categories
})
// **Changes end here
})
}

Dynamic Country-State-City using AutoForm and Collection2 package in Meteor

I am using autoform and collection2 package and making a form in meteor. As of now i put some hard-coded option for country-state-city dropdown and insert-update is working fine. Now I want for the first time only country dropdown is enable other two are disable. Based on Country selection the states dropdown will populate and enable. Then based on State selection City Should Populate.
I don't want to do this manually. Is there any way to do this using autoform / collection2 features??? My code sample is as follows:
Collection2 Schema:
country:{
type: String,
label : "Country",
autoform: {
afFieldInput: {
type: "select"
},
options: function () {
return [
{label: 'Country1', value: 'Country1'},
{label: 'Country2', value: 'Country2'},
{label: 'Country3', value: 'Country3'},
{label: 'Country4', value: 'Country4'}
];
}
}
},
state:{
type: String,
label : "State",
autoform: {
afFieldInput: {
type: "select"
},
options: function () {
return [
{label: 'State1', value: 'State1'},
{label: 'State2', value: 'State2'},
{label: 'State3', value: 'State3'},
{label: 'State4', value: 'State4'}
];
}
}
},
city:{
type: String,
label : "City",
autoform: {
afFieldInput: {
type: "select"
},
options: function () {
return [
{label: 'City1', value: 'City1'},
{label: 'City2', value: 'City2'},
{label: 'City3', value: 'City3'},
{label: 'City4', value: 'City4'}
];
}
}
},
HTML ::
{{> afQuickField name='country' template="bootstrap3-horizontal" label-class="col-sm-4" input-col-class="col-sm-8"}}
{{> afQuickField name='state' template="bootstrap3-horizontal" label-class="col-sm-4" input-col-class="col-sm-8"}}
{{> afQuickField name='city' template="bootstrap3-horizontal" label-class="col-sm-4" input-col-class="col-sm-8"}}
Any Help??
I think this is somewhat the idea you have, https://jsfiddle.net/bdhacker/eRv2W/
// Countries
var country_arr = new Array("Afghanistan", "Albania", "Algeria", "American Samoa", "Angola", "Anguilla", "Antartica"...
// States
var s_a = new Array();
s_a[0] = "";
s_a[1] = "Badakhshan|Badghis|Baghlan|Balkh|Bamian|Farah|Faryab|Ghazni|Ghowr|Helmand|Herat|Jowzjan|Kabol|Kandahar|Kapisa|Konar|Kondoz|Laghman|Lowgar|Nangarhar|Nimruz|Oruzgan|Paktia|Paktika|Parvan|Samangan|Sar-e Pol|Takhar|Vardak|Zabol";...
you can extract the data from this and adjust to your app. Hope it helps
i think you can set the inputs of state and city to be disabled
country:{
type: String,
label : "Country",
autoform: {
afFieldInput: {
type: "select"
},
options: function () {
return [
{label: 'Country1', value: 'Country1'},
{label: 'Country2', value: 'Country2'},
{label: 'Country3', value: 'Country3'},
{label: 'Country4', value: 'Country4'}
];
}
}
},
state:{
type: String,
label : "State",
autoform: {
afFieldInput: {
type: "select",
disabled:true
},
options: function () {
return [
{label: 'State1', value: 'State1'},
{label: 'State2', value: 'State2'},
{label: 'State3', value: 'State3'},
{label: 'State4', value: 'State4'}
];
}
}
},
city:{
type: String,
label : "City",
autoform: {
afFieldInput: {
type: "select",
disabled:true
},
options: function () {
return [
{label: 'City1', value: 'City1'},
{label: 'City2', value: 'City2'},
{label: 'City3', value: 'City3'},
{label: 'City4', value: 'City4'}
];
}
}
},
and use Template event to enable the options
Template.YOURTEMPLATENAME.events({
'change input[name="country"]' :function(){
if ($('input[name="country"]').value() != ''){
$('input[name="state"]').attr('disabled','');
}else {
$('input[name="state"]').attr('disabled','disabled');
}
},
'change input[name="state"]' :function(){
if ($('input[name="state"]').value() != ''){
$('input[name="city"]').attr('disabled','');
}else {
$('input[name="city"]').attr('disabled','disabled');
}
}
});

ExtJS:based on combobox values hide and unhide the fields and pass it to springMVC

I have two dropdowns in extjs,based on the first dropdwon,the second dropdown populates.This is working fine and i am able to pass the values to springMVC,but problem comes when i have to hide/unhide the textfields based on the second dropdown,hiding/unhiding works fine,but i am unable to pass the parametrs to SpringMVC.
Here is my .js files.
Could anybody tell where i have to correct,
Ext.Loader.setConfig({
enabled: true
});
Ext.require(['*']);
var country = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data: [{
"abbr": "USA",
"name": "USA"
}, {
"abbr": "UK",
"name": "UK"
},
]
});
var states = Ext.create('Ext.data.Store', {
fields: ['id', 'abbr', 'name'],
data: [{
"id": "New York",
"abbr": "USA",
"name": "New York"
}, {
"id": "New Jersey",
"abbr": "USA",
"name": "New Jersey"
}, {
"id": "London",
"abbr": "UK",
"name": "London"
}, {
"id": "Hampshire",
"abbr": "UK",
"name": "Hampshire"
}]
});
Ext.define('App.view.countryPanel', {
extend: 'Ext.form.Panel',
alias: 'widget.CountryPanel',
id: 'countrypanel',
title: 'Country',
frame: true,
width: 400,
fieldDefaults: {
labelWidth: 200
},
bodyPadding: '15 16 10',
height: 200,
id: 'countrypanel',
method: 'POST',
items: [
{
xtype: 'combo',
id: 'con',
name: 'con',
fieldLabel: 'Country',
displayField: 'name',
emptyText: 'Select a Country',
valueField: 'abbr',
store: country,
listeners: {
'select': {
fn: function (combo, value) {
var comboState = Ext.getCmp('statelist');
comboState.bindStore(states);
comboState.clearValue();
comboState.store.filter('abbr', combo.getValue());
states = Ext.create('Ext.data.Store', {
fields: ['id', 'abbr', 'name'],
data: [{
"id": "New York",
"abbr": "USA",
"name": "New York"
}, {
"id": "New Jersey",
"abbr": "USA",
"name": "New Jersey"
}, {
"id": "London",
"abbr": "UK",
"name": "London"
}, {
"id": "Hampshire",
"abbr": "UK",
"name": "Hampshire"
}]
});
}
}
}
}, {
xtype: 'combo',
id: 'statelist',
name: 'statelist',
fieldLabel: 'Stated',
displayField: 'name',
emptyText: 'Select states',
valueField: 'id',
store: states,
listeners: {
'select': {
fn: function (combo, value) {
var sample = combo.getValue();
if (sample == 'London') {
Ext.getCmp('Tower').getEl().show();
} else {
Ext.getCmp('Tower').getEl().hide();
Ext.getCmp('Liberty').getEl().show();
}
var comboState = Ext.getCmp('statelist');
comboState.bindStore(states);
comboState.clearValue();
comboState.store.filter('abbr', combo.getValue());
}
}
}
}, {
xtype: 'textfield',
id: 'Tower',
name: 'Tower',
fieldLabel: 'ClockTower',
hidden: true,
allowBlank: false
}, {
xtype: 'textfield',
id: 'Liberty',
name: 'Liberty',
fieldLabel: 'Liberty',
hidden: true,
minWidth: 20,
allowBlank: false
}],
buttonAlign: 'center',
buttons: [
{
text: 'Submit',
handler: function () {
var sspanel = Ext.getCmp('countrypanel');
var form = sspanel.getForm();
form.submit({
url: 'country.htm',
success: function (form, action) {
Ext.Msg.alert('Success');
},
failure: function (form, action) {
Ext.Msg.alert('failure');
}
});
}
},
{
text: 'Reset',
handler: function () {
var sspanel = Ext.getCmp('countrypanel');
var form = sspanel.getForm();
form.reset();
}
}
]
});
Try to use the hideMode config option for text fields:
{
xtype: 'textfield',
id: 'Liberty',
name: 'Liberty',
fieldLabel: 'Liberty',
hidden: true,
hideMode: 'visibility', // you may also use 'offsets'
minWidth: 20,
allowBlank: false
}
In this case the fields' values will be passed as parameters.

Resources