Permalink
Browse files

NestedList: possibility to use ajax

  • Loading branch information...
jecisc committed Jan 6, 2017
1 parent 21c0535 commit feaba4356521446e7f4b2eca3ca921ba8c1b262b
@@ -2,4 +2,5 @@ initialization
initialize
super initialize.
self displayResearchField: false.
self isJsAction: false.
self listStyle: #standard
@@ -0,0 +1,3 @@
accessing
isJsAction: anObject
isJsAction := anObject
@@ -0,0 +1,3 @@
accessing
isJsAction
^ isJsAction
@@ -0,0 +1,4 @@
accessing
onClickJs: anActionBlock
self actionBlock: anActionBlock.
self isJsAction: true
@@ -2,14 +2,31 @@ rendering
renderAnchor: aNode withId: anId index: anIndex inDiv: div indentedBy: anInteger on: html
| anchor |
anchor := html anchor.
self actionBlock ifNotNil: [ anchor onClick: 'goTo(event)' ].
self actionBlock
ifNotNil: [
self isJsAction
ifTrue: [
anchor
onClick:
((self actionBlock value: aNode element)
onComplete:
((html jQuery id: div) load
html: [ :ajaxHtml |
self
renderItemContentOf: aNode
index: anIndex
indentedBy: anInteger
on: ajaxHtml ])) ]
ifFalse: [ anchor onClick: 'goTo(event)' ] ].
anchor
with: [ html span
with: [
html span
class: #item;
id: anId;
with: [ html text: ((self format value: aNode element) ifEmpty: [ $  ]) ].
self renderHelpOf: aNode element at: anId on: html ].
aNode children
ifNotEmpty: [ html div
ifNotEmpty: [
html div
onClick: 'expandCollapse(this)';
class: #icon ]
@@ -10,6 +10,7 @@
"filteredElements",
"format",
"actionBlock",
"isJsAction",
"selectedEntity",
"helpBlock",
"iconBlock",

0 comments on commit feaba43

Please sign in to comment.