0
1
Fork 0
This commit is contained in:
Juan Ferrer Toribio 2017-04-10 18:23:40 +02:00
parent 22ee7e5020
commit 73b2fed910
13 changed files with 120 additions and 125 deletions

View File

@ -1,5 +1,5 @@
<vn>
<vn-basic-set id="lot"/>
<vn-lot id="lot"/>
<h1 id="title">
<t>Item list</t>
</h1>

View File

@ -1,5 +1,5 @@
<vn>
<vn-basic-set id="lot"/>
<vn-lot id="lot"/>
<h1 id="title">
<t>Shelves</t>
</h1>
@ -35,7 +35,7 @@
</div>
<div>
<label><t>Reign</t></label>
<htk-combo lot="lot" name="realm" id="realm">
<htk-combo lot="lot" name="realm">
<db-model property="model">
SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino

View File

@ -269,7 +269,7 @@ Hedera.Catalog = new Class
this.onEraseClick ();
this.$('card').row = form.row;
this.$('card-item').value = form.get ('item_id');
this.$('card-lot').assign ({item: form.get ('item_id')});
this.$('card-popup').show (button.node);
}

View File

@ -1,6 +1,6 @@
<vn>
<vn-group>
<vn-param id="card-item"/>
<vn-lot id="card-lot"/>
<vn-param id="realm" on-changed="onRealmChange"/>
<vn-param id="type" on-changed="onTypeChange"/>
<vn-param id="search" on-changed="onFilterChange"/>
@ -82,15 +82,10 @@
</sql-batch>
</db-model>
<db-form id="card" model="items-model"/>
<sql-batch id="card-batch">
<custom>
<item name="item" param="card-item"/>
</custom>
</sql-batch>
<db-form id="card-extend">
<db-model
property="model"
batch="card-batch"
lot="card-lot"
on-status-changed-after="onStatusChange">
SELECT a.description, o.str origin
FROM vn2008.Articles a

View File

@ -1,6 +1,6 @@
<vn>
<vn-group>
<vn-basic-set id="lot" on-change="onAddressChange"/>
<vn-lot id="lot" on-change="onAddressChange"/>
<db-form id="defaults" on-ready="onValuesReady">
<db-model property="model">
SELECT delivery_method, agency_id, address_id

View File

@ -1,6 +1,6 @@
<vn>
<vn-group>
<vn-basic-set id="lot"/>
<vn-lot id="lot"/>
<db-form id="order" on-ready="onOrderReady">
<db-model property="model" result-index="1">
CALL basket_get_vat ();

View File

@ -3,7 +3,7 @@ var Model = require ('./model');
module.exports = new Class
({
Implements: Vn.Lot
Implements: Vn.LotIface
,Properties:
{
/**

View File

@ -106,7 +106,7 @@ Model.implement
*/
lot:
{
type: Vn.Lot
type: Vn.LotIface
,set: function (x)
{
this.link ({_lot: x}, {'change': this._onLotChange});

View File

@ -1,66 +0,0 @@
var Object = require ('./object');
var Lot = require ('./lot');
module.exports = new Class
({
Extends: Object
,Implements: Lot
,Tag: 'vn-basic-set'
,Properties:
{
params:
{
type: Object
,set: function (x)
{
this._params = x;
this.changed ();
}
,get: function ()
{
return this._params;
}
}
}
,initialize: function (props)
{
this._params = {};
this.parent (props);
}
,get: function (paramName)
{
return this._params[paramName];
}
,set: function (paramName, value)
{
this._params[paramName] = value;
this.changed ();
}
/**
* Resets all values.
*/
,reset: function ()
{
this._params = {};
this.changed ();
}
,keys: function ()
{
return Object.keys (this._params);
}
,assign: function (object)
{
for (var key in object)
this._params[key] = object[key];
this.changed ();
}
});

View File

@ -1,7 +1,7 @@
var VnObject = require ('./object');
var VnDate = require ('./date');
var Lot = require ('./lot');
var LotIface = require ('./lot-iface');
var Value = require ('./value');
/**
@ -10,7 +10,7 @@ var Value = require ('./value');
module.exports = new Class
({
Extends: VnObject
,Implements: Lot
,Implements: LotIface
,Properties: {
window:
{

64
js/vn/lot-iface.js Normal file
View File

@ -0,0 +1,64 @@
module.exports = new Class
({
Properties:
{
/**
* The internal object with the params.
*/
params:
{
type: Object
}
}
/**
* Gets a value from the set.
*
* @param {String} field The field name
* @return {*} The field value
*/
,get: function () {}
/**
* Sets a value on the set.
*
* @param {String} field The field name
* @param {*} value The new field value
*/
,set: function () {}
/**
* Returns an array with the set keys.
*
* @return {Array} The set keys
*/
,keys: function () {}
/**
* Emits the 'change' signal on the set.
*/
,changed: function ()
{
this.signalEmit ('change');
}
/**
* Copies all values from another set.
*
* @param {Object} object The source object
*/
,assign: function (object)
{
for (var key in object)
this.set (key, object[key]);
this.changed ();
}
,assignLot: function (lot)
{
this.assign (lot.params);
}
});

View File

@ -1,64 +1,66 @@
var Object = require ('./object');
var LotIface = require ('./lot-iface');
module.exports = new Class
({
Properties:
Extends: Object
,Implements: LotIface
,Tag: 'vn-lot'
,Properties:
{
/**
* The internal object with the params.
*/
params:
{
type: Object
}
}
/**
* Gets a value from the set.
*
* @param {String} field The field name
* @return {*} The field value
*/
,get: function () {}
/**
* Sets a value on the set.
*
* @param {String} field The field name
* @param {*} value The new field value
*/
,set: function () {}
/**
* Returns an array with the set keys.
*
* @return {Array} The set keys
*/
,keys: function () {}
/**
* Emits the 'change' signal on the set.
*/
,changed: function ()
,set: function (x)
{
this.signalEmit ('change');
this._params = x;
this.changed ();
}
,get: function ()
{
return this._params;
}
}
}
/**
* Copies all values from another set.
*
* @param {Object} object The source object
*/
,assign: function (object)
,initialize: function (props)
{
for (var key in object)
this.set (key, object[key]);
this._params = {};
this.parent (props);
}
,get: function (paramName)
{
return this._params[paramName];
}
,set: function (paramName, value)
{
this._params[paramName] = value;
this.changed ();
}
,assignLot: function (lot)
/**
* Resets all values.
*/
,reset: function ()
{
this.assign (lot.params);
this._params = {};
this.changed ();
}
,keys: function ()
{
return Object.keys (this._params);
}
,assign: function (object)
{
for (var key in object)
this._params[key] = object[key];
this.changed ();
}
});

View File

@ -12,8 +12,8 @@ Vn = module.exports = {
,Date : require ('./date')
,Value : require ('./value')
,Url : require ('./url')
,LotIface : require ('./lot-iface')
,Lot : require ('./lot')
,BasicLot : require ('./basic-lot')
,Hash : require ('./hash')
,Param : require ('./param')
,Node : require ('./node')