Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
ecommerce-ui
Commits
be5140df
Commit
be5140df
authored
Oct 16, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removes column sorting from JQM table extension to template factory
parent
556f8af9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
28 deletions
+36
-28
data/invoices_01.json
data/invoices_01.json
+1
-1
js/erp5_loader.js
js/erp5_loader.js
+35
-12
js/extensions.js
js/extensions.js
+0
-15
No files found.
data/invoices_01.json
View file @
be5140df
{
"portal_type_source"
:
"Sale Invoice Transaction"
,
"portal_type_title"
:
"invoices"
,
"base_element"
:
{
"type"
:
"table"
,
"direct"
:
{
"id"
:
"invoices_01"
,
"className"
:
"table-stroke ui-responsive"
},
"attributes"
:
{
"data-filter"
:
"true"
,
"data-
sort"
:
"true"
,
"data-
input"
:
"#global_search_invoices"
,
"data-mode"
:
"columntoggle"
,
"data-use-pop"
:
false
,
"data-wrap"
:
"both"
,
"data-top-grid"
:
3
,
"data-bottom-grid"
:
1
,
"data-sorting"
:
"true"
},
"logic"
:
{}},
"base_element"
:
{
"type"
:
"table"
,
"direct"
:
{
"id"
:
"invoices_01"
,
"className"
:
"table-stroke ui-responsive"
},
"attributes"
:
{
"data-filter"
:
"true"
,
"data-input"
:
"#global_search_invoices"
,
"data-mode"
:
"columntoggle"
,
"data-use-pop"
:
false
,
"data-wrap"
:
"both"
,
"data-top-grid"
:
3
,
"data-bottom-grid"
:
1
,
"data-sorting"
:
"true"
},
"logic"
:
{}},
"form_wrapper"
:
null
,
"initial_query"
:
{
"include_documents"
:
true
,
"limit"
:[
0
,
10
]},
"configuration"
:
{
...
...
js/erp5_loader.js
View file @
be5140df
...
...
@@ -347,8 +347,10 @@
property
,
keys
,
title
,
temp
=
{},
set
,
text
,
temp
=
{},
link
=
undefined
,
check
=
settings
.
configuration
.
table
.
checkbox_rows
,
merger
=
settings
.
configuration
.
table
.
mergeable_columns
,
target
=
settings
.
layout
.
columns
,
...
...
@@ -382,6 +384,7 @@
}
for
(
l
=
0
;
l
<
target
.
length
;
l
+=
1
)
{
link
=
undefined
;
field
=
target
[
l
];
config
=
{};
property
=
field
.
title
;
...
...
@@ -398,20 +401,33 @@
if
(
field
.
persist
===
undefined
)
{
config
[
"
data-priority
"
]
=
field
.
priority
||
6
;
}
if
(
settings
.
configuration
.
table
.
sorting_columns
&&
field
.
sort
)
{
config
[
"
data-sorting
"
]
=
true
;
}
if
(
field_config
)
{
title
=
temp
[
property
]
||
field_config
.
widget
.
title
;
}
else
{
title
=
util
.
capFirstLetter
(
property
);
}
if
(
settings
.
configuration
.
table
.
sorting_columns
&&
field
.
sort
)
{
text
=
{}
link
=
factory
.
generateElement
(
"
a
"
,
{
"
className
"
:
"
action ui-sorting ui-btn ui-icon-sort
"
+
"
ui-icon ui-btn-icon-right
"
},
{
"
data-action
"
:
"
sort
"
,
"
data-i18n
"
:
""
,
"
data-reference
"
:
settings
.
base_element
.
direct
.
id
},
{
"
text
"
:
title
}
);
}
else
{
text
=
{
"
text
"
:
title
}
}
cell
=
factory
.
generateElement
(
"
th
"
,
{
"
className
"
:
"
translate
"
},
config
,
{
"
text
"
:
title
}
"
th
"
,
{
"
className
"
:
"
translate
"
},
config
,
text
);
if
(
link
)
{
cell
.
appendChild
(
link
);
}
if
(
merger
)
{
row
.
insertBefore
(
cell
,
...
...
@@ -2871,10 +2887,17 @@
/* ***************************** ENTRY POINT *************************** */
// NOTE:
// util = utilities methods
// factory = content generator methods
// INSTRUCTIONS
// util = utilities/helper methods
// factory = content generator methods (templating system)
// init = initialization methods
// erp5 = custom methods for erp5 = "mapped" to factory object
// erp5 = custom methods for erp5 = "mapped" to factory
// ACTIONS
// > class "action" data-action="which_action" data-reference="which_id"
// > set these on an element to hook up to handlers
// > in erp5.map_actions, add a method "which_action"
// > will be run on "click" & "change"
// TODO: run earlier, not on "ready" > http://bit.ly/10Nvgly
$
(
document
)
...
...
@@ -2902,7 +2925,7 @@
.
on
(
"
pageremove
"
,
"
div.ui-page
"
,
function
(
e
)
{
var
id
=
e
.
target
.
id
;
// clear
memory
// clear
cache for this page!
delete
ram_cache
[
id
];
});
...
...
js/extensions.js
View file @
be5140df
...
...
@@ -457,7 +457,6 @@ $.widget( "mobile.table", $.mobile.table, {
columnPopupTheme
:
null
,
columnBtnText
:
"
Columns...
"
,
columnBtnIcon
:
"
Search
"
,
sort
:
null
,
wrap
:
null
,
embedded
:
null
,
topGrid
:
null
,
...
...
@@ -500,9 +499,6 @@ $.widget( "mobile.table", $.mobile.table, {
// add responsive CSS
this
.
_addResponsiveClassAndLabel
();
}
if
(
o
.
sort
)
{
this
.
_setSorting
();
}
if
(
o
.
wrap
)
{
this
.
_wrapTable
();
}
...
...
@@ -705,17 +701,6 @@ $.widget( "mobile.table", $.mobile.table, {
}
},
_setSorting
:
function
()
{
var
sorts
=
this
.
element
.
find
(
"
thead tr th[data-sorting]
"
),
btn
=
$
(
"
<a />
"
,
{
class
:
"
ui-sorting ui-btn ui-icon-sort ui-icon ui-btn-icon-right
"
,
});
sorts
.
each
(
function
(
i
,
el
)
{
var
$el
=
$
(
el
);
$el
.
html
(
btn
.
clone
().
text
(
$el
.
text
()
)
);
});
},
rebuild
:
function
()
{
this
.
_super
();
...
...
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