Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
764d8593
Commit
764d8593
authored
Sep 21, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add listnode item to table and edit correct item
parent
2072228e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
28 deletions
+40
-28
nodeTable.html
app/shared/templates/nodeTable.html
+25
-17
form_service.js
app/zetalib/forms/form_service.js
+15
-11
No files found.
app/shared/templates/nodeTable.html
View file @
764d8593
<div
class=
"tablescroll"
>
<table
class=
"table table-bordered"
style=
"background-color:#fff;"
>
<thead>
<tr>
<tr
ng-if=
"node.schema.formType=='Node'"
>
<!--<th colspan="2">-->
<!--<label>-->
<!--<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">-->
<!--Hepsini Seç-->
<!--</label>-->
<!--</th>-->
<th
ng-repeat=
"(key,value) in node.model"
>
{{ key }}
</th>
<th>
İşlem
</th>
</tr>
<tr
ng-if=
"node.schema.formType=='ListNode'"
>
<th
colspan=
"2"
>
<label>
<input
type=
"checkbox"
style=
"zoom:1.5; margin:5px 0 0 8px;"
>
Hepsini Seç
</label>
</th>
<th
ng-repeat=
"(key,value) in node.model"
>
{{ key }}
</th>
<th>
action
</th>
<th
ng-repeat=
"(key,value) in node.model
[0]
"
>
{{ key }}
</th>
<th>
İşlem
</th>
</tr>
</thead>
<tbody
ng-class=
"{hidden: node.lengthModels < 1}"
>
<tr
ng-if=
"node.schema.formType=='Node'"
>
<
td
width=
"60"
>
<
label
>
<
input
type=
"checkbox"
style=
"zoom:1.5; margin:5px 0 0 8px;"
>
<
/label
>
<
/td
>
<
th
scope=
"row"
style=
"text-align:center"
>
1
</th
>
<
!--<td width="60">--
>
<
!--<label>--
>
<
!--<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">--
>
<
!--</label>--
>
<
!--</td>--
>
<
!--<th scope="row" style="text-align:center">1</th>--
>
<td
ng-repeat=
"value in node.model"
>
{{ value }}
</td>
<td>
<button
modal-for-nodes=
"{{node.schema.model_name}},{{node.schema.formType}},edit"
>
Edit
</button><br>
<button>
Show
</button>
<button>
Delete
</button>
<button
modal-for-nodes=
"{{node.schema.model_name}},{{node.schema.formType}},edit"
>
Düzenle
</button><br>
<button>
Sil
</button>
</td>
</tr>
...
...
@@ -35,12 +44,11 @@
<input
type=
"checkbox"
style=
"zoom:1.5; margin:5px 0 0 8px;"
>
</label>
</td>
<th
scope=
"row"
style=
"text-align:center"
>
1
</th>
<td
ng-repeat=
"
value in listnodemodel"
>
{{ value
}}
</td>
<th
scope=
"row"
style=
"text-align:center"
>
{{$index+1}}
</th>
<td
ng-repeat=
"
(k, v) in listnodemodel"
>
{{ v
}}
</td>
<td>
<button
modal-for-nodes=
"{{node.schema.model_name}},{{node.schema.formType}},edit"
>
Edit
</button><br>
<button>
Show
</button>
<button>
Delete
</button>
<button
modal-for-nodes=
"{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}"
>
Düzenle
</button><br>
<button>
Sil
</button>
</td>
</tr>
...
...
app/zetalib/forms/form_service.js
View file @
764d8593
...
...
@@ -126,7 +126,7 @@ form_generator.factory('Generator', function ($http, $q, $log, $location, $modal
};
if
(
scope
.
model
[
v
]
==
null
)
{
scope
[
k
.
type
][
v
].
model
=
k
.
type
==
'Node'
?
[]
:
{}
;
scope
[
k
.
type
][
v
].
model
=
k
.
type
==
'Node'
?
{}
:
[]
;
}
else
{
scope
[
k
.
type
][
v
].
model
=
scope
.
model
[
v
];
}
...
...
@@ -286,34 +286,38 @@ form_generator.directive('modalForNodes', function ($modal) {
resolve
:
{
items
:
function
()
{
var
attribs
=
attributes
[
'modalForNodes'
].
split
(
','
);
debugger
;
// get node from parent scope catch with attribute
var
node
=
angular
.
copy
(
scope
.
$parent
[
attribs
[
1
]][
attribs
[
0
]]);
if
(
attribs
[
2
]
==
'add'
){
node
.
model
=
{};
}
if
(
attribs
[
3
]){
// if listnode catch edit object with index
node
.
model
=
node
.
model
[
attribs
[
3
]];
}
// tell result.then function which item to edit
node
.
edit
=
attribs
[
3
];
return
node
;
}
}
});
modalInstance
.
result
.
then
(
function
(
childmodel
,
key
)
{
// subfix will be removed
//var subfix = scope.schema.title.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
if
(
childmodel
.
schema
.
formType
==
'Node'
)
{
//scope.$parent.model[childmodel.schema.model_name] = childmodel.model;
scope
.
$parent
[
childmodel
.
schema
.
formType
][
childmodel
.
schema
.
model_name
].
model
=
childmodel
.
model
;
}
if
(
childmodel
.
schema
.
formType
==
'ListNode'
)
{
if
(
scope
.
$parent
.
model
[
childmodel
.
schema
.
model_name
]
==
null
)
{
scope
.
$parent
.
model
[
childmodel
.
schema
.
model_name
]
=
[];
if
(
childmodel
.
edit
){
scope
.
$parent
[
childmodel
.
schema
.
formType
][
childmodel
.
schema
.
model_name
].
model
[
childmodel
.
edit
]
=
childmodel
.
model
;
}
else
{
scope
.
$parent
[
childmodel
.
schema
.
formType
][
childmodel
.
schema
.
model_name
].
model
.
push
(
childmodel
.
model
);
}
//scope.$parent.model[childmodel.schema.model_name].push(childmodel.model);
scope
.
$parent
[
childmodel
.
schema
.
formType
][
childmodel
.
schema
.
model_name
].
model
.
push
(
childmodel
.
model
);
}
scope
.
$parent
[
childmodel
.
schema
.
formType
][
childmodel
.
schema
.
model_name
].
lengthModels
+=
1
;
...
...
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