Skip to content

Commit

Permalink
Merge branch 'master' into 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
yurychika committed Oct 14, 2014
2 parents 1a33bdb + 559d770 commit 2002490
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 9 deletions.
7 changes: 5 additions & 2 deletions modules/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,11 @@ define([
if(col.storePattern && (col.dataType == 'date' || col.dataType == 'time')){
return locale.parse(storeData, col.storePattern);
}
//Some editor like textbox will ignore setting undefined value.
return gridData === undefined ? null : gridData;
if(col.editorArgs && col.editorArgs.useGridData === true){
//Some editor like textbox will ignore setting undefined value.
return gridData === undefined ? null : gridData;
}
return gridData === undefined ? null : storeData;
}

function dateTimeFormatter(field, parseArgs, formatArgs, rawData){
Expand Down
4 changes: 3 additions & 1 deletion modules/extendedSelect/Row.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ define([
return declare(_RowCellBase, {
name: 'selectRow',

allowRight: false, //allow mouse right click to trigger select

rowMixin: {
select: function(){
this.grid.select.row.selectById(this.id);
Expand Down Expand Up @@ -255,7 +257,7 @@ define([
t.batchConnect(
g.rowHeader && [g.rowHeader, 'onMoveToRowHeaderCell', '_onMoveToRowHeaderCell'],
[g, 'onRowMouseDown', function(e){
if(mouse.isLeft(e) && canSelect(e)){
if((mouse.isLeft(e) || t.arg('allowRight')) && canSelect(e)){
t._isOnCell = e.columnId;
if(t._isOnCell){
g.body._focusCellCol = e.columnIndex;
Expand Down
9 changes: 8 additions & 1 deletion modules/filter/FilterBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,14 @@ define([
}else if(condition === 'range'){
tpl = this.arg('rangeTemplate', this.grid.nls.rangeTemplate);
valueString = string.substitute(tpl, [value.start, value.end]);
}else{
}else if(condition === 'past' && value.interval && value.amount !== undefined){
var interval = value.interval;
tpl = this.grid.nls['past' + interval[0].toUpperCase() + interval.substring(1) + 'sConditionTemplate'];
if(tpl){
valueString = string.substitute(tpl, [value.amount]);
}
}
else{
valueString = value;
}
if(this.grid.textDir){
Expand Down
4 changes: 4 additions & 0 deletions nls/gridx.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ define({root:

"rangeTo": "to",
"rangeTemplate": "from ${0} to ${1}",
"pastHoursConditionTemplate": "${0} hours",
"pastDaysConditionTemplate": "${0} days",
"pastMonthsConditionTemplate": "${0} months",
"pastYearsConditionTemplate": "${0} years",

"statusTipHeaderColumn": "Column",
"statusTipHeaderCondition": "Rules",
Expand Down
3 changes: 2 additions & 1 deletion resources/basic.less
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@
width: 100%;
/*height: 100px;*/
height: 100%;
box-sizing: border-box;
/*box-sizing: border-box;*/
.boxSizing(border-box);
padding: 30px 0;
text-align: center;
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion resources/claro/Gridx.css

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/test_grid_indirectSelect.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ <h2>IndirectSelect with extended selection (trigger on cell)</h2>
"gridx/modules/Pagination",
"gridx/modules/pagination/PaginationBar",
"gridx/modules/VirtualVScroller"
]
],
selectRowAllowRight: false
'></div>
</td>
</tr><tr>
Expand Down
5 changes: 3 additions & 2 deletions tests/test_grid_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ require([
SelectColumn,
SelectCell,
VirtualVScroller
]
],
selectRowTriggerOnCell: true
});
grid.placeAt('gridContainer');
grid.startup();
grid.startup();

//Test functions
rowSelectById = function(){
Expand Down

0 comments on commit 2002490

Please sign in to comment.