Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
63ee6cbc
Commit
63ee6cbc
authored
Jul 02, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handsontable: expose handsontable configuration on gadget render method
parent
60ab3ff6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
dream/platform/src2/handsontable/handsontable.js
dream/platform/src2/handsontable/handsontable.js
+3
-3
dream/platform/src2/handsontable/test.js
dream/platform/src2/handsontable/test.js
+29
-0
No files found.
dream/platform/src2/handsontable/handsontable.js
View file @
63ee6cbc
...
...
@@ -4,15 +4,15 @@
"
use strict
"
;
rJS
(
window
)
.
declareMethod
(
'
render
'
,
function
(
content
)
{
.
declareMethod
(
'
render
'
,
function
(
content
,
options
)
{
var
data
=
JSON
.
parse
(
content
);
return
this
.
getElement
()
.
push
(
function
(
element
)
{
$
(
element
).
find
(
'
.table-container
'
)
.
handsontable
({
.
handsontable
(
$
.
extend
(
{
data
:
data
,
stretchH
:
'
all
'
});
}
,
options
||
{})
);
});
})
...
...
dream/platform/src2/handsontable/test.js
View file @
63ee6cbc
...
...
@@ -54,6 +54,35 @@
})
.
always
(
start
);
});
test
(
"
the gadget can be configured
"
,
function
()
{
var
hstable_gadget
;
stop
();
g
.
declareGadget
(
"
./index.html
"
,
{
element
:
document
.
querySelector
(
"
#qunit-fixture
"
)
})
.
then
(
function
(
new_gadget
)
{
hstable_gadget
=
new_gadget
;
return
hstable_gadget
.
render
(
sample
,
{
minSpareRows
:
1
});
})
.
then
(
function
()
{
var
rows
=
$
(
'
table tbody tr
'
);
// There is one spare row
equal
(
rows
.
length
,
4
);
})
.
then
(
function
()
{
return
hstable_gadget
.
getData
();
})
.
then
(
function
(
data
)
{
equal
(
data
,
JSON
.
stringify
([
[
"
row1
"
,
"
data11
"
,
"
data12
"
,
"
data13
"
],
[
"
row2
"
,
"
data21
"
,
"
data22
"
,
"
data23
"
],
[
"
row3
"
,
"
data31
"
,
"
data32
"
,
"
data33
"
],
[
null
,
null
,
null
,
null
]]));
})
.
always
(
start
);
});
});
}(
rJS
,
JSON
,
QUnit
,
jQuery
));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment