Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
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
dataplatform
atlas
Commits
f0f7fe2c
Commit
f0f7fe2c
authored
May 19, 2017
by
kevalbhatt
Committed by
Madhan Neethiraj
May 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1816: button to navigate to next page in search-result is disabled incorrectly
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
0cccec93
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
36 deletions
+25
-36
SearchResultLayoutView.js
dashboardv2/public/js/views/search/SearchResultLayoutView.js
+25
-36
No files found.
dashboardv2/public/js/views/search/SearchResultLayoutView.js
View file @
f0f7fe2c
...
...
@@ -235,20 +235,16 @@ define(['require',
}
}
},
fetchCollection
:
function
(
value
,
deleteChecked
)
{
fetchCollection
:
function
(
value
,
clickObj
)
{
var
that
=
this
;
this
.
showLoader
();
if
(
Globals
.
searchApiCallRef
&&
Globals
.
searchApiCallRef
.
readyState
===
1
)
{
Globals
.
searchApiCallRef
.
abort
();
}
if
(
value
&&
!
value
.
paginationChange
)
{
$
.
extend
(
this
.
searchCollection
.
queryParams
,
{
limit
:
this
.
limit
});
if
(
value
)
{
$
.
extend
(
this
.
searchCollection
.
queryParams
,
{
limit
:
this
.
limit
,
excludeDeletedEntities
:
true
});
if
(
value
.
searchType
)
{
this
.
searchCollection
.
url
=
UrlLinks
.
searchApiUrl
(
value
.
searchType
);
if
(
deleteChecked
===
undefined
)
{
$
.
extend
(
this
.
searchCollection
.
queryParams
,
{
limit
:
this
.
limit
,
excludeDeletedEntities
:
true
});
}
this
.
offset
=
0
;
}
_
.
extend
(
this
.
searchCollection
.
queryParams
,
{
'query'
:
(
value
.
query
?
value
.
query
.
trim
()
:
null
),
'typeName'
:
value
.
type
||
null
,
'classification'
:
value
.
tag
||
null
});
}
...
...
@@ -259,38 +255,29 @@ define(['require',
if
(
!
(
that
.
ui
.
pageRecordText
instanceof
jQuery
))
{
return
;
}
if
(
value
)
{
if
(
that
.
searchCollection
.
models
.
length
<
that
.
limit
)
{
that
.
ui
.
nextData
.
attr
(
'disabled'
,
true
);
}
else
{
that
.
ui
.
nextData
.
attr
(
'disabled'
,
false
);
}
if
(
that
.
offset
===
0
)
{
that
.
pageFrom
=
1
;
that
.
pageTo
=
that
.
limit
;
if
(
that
.
searchCollection
.
length
>
0
)
{
that
.
ui
.
pageRecordText
.
html
(
"Showing "
+
that
.
pageFrom
+
" - "
+
that
.
searchCollection
.
length
);
}
}
else
if
(
that
.
searchCollection
.
models
.
length
&&
!
that
.
previousClick
)
{
//on next click, adding "1" for showing the another records..
that
.
pageFrom
=
that
.
pageTo
+
1
;
that
.
pageTo
=
that
.
pageTo
+
that
.
searchCollection
.
models
.
length
;
if
(
that
.
pageFrom
&&
that
.
pageTo
)
{
that
.
ui
.
pageRecordText
.
html
(
"Showing "
+
that
.
pageFrom
+
" - "
+
that
.
pageTo
);
}
}
else
if
(
that
.
previousClick
)
{
that
.
pageTo
=
(
that
.
pageTo
-
(
that
.
pageTo
-
that
.
pageFrom
))
-
1
;
//if limit is 0 then result is change to 1 because page count is showing from 1
that
.
pageFrom
=
(
that
.
pageFrom
-
that
.
limit
===
0
?
1
:
that
.
pageFrom
-
that
.
limit
);
that
.
ui
.
pageRecordText
.
html
(
"Showing "
+
that
.
pageFrom
+
" - "
+
that
.
pageTo
);
}
if
(
that
.
offset
<
that
.
limit
)
{
}
else
if
(
clickObj
&&
clickObj
.
next
)
{
//on next click, adding "1" for showing the another records.
that
.
pageTo
=
that
.
offset
+
that
.
limit
;
that
.
pageFrom
=
that
.
offset
+
1
;
}
else
if
(
clickObj
&&
clickObj
.
previous
)
{
that
.
pageTo
=
that
.
pageTo
-
that
.
limit
;
that
.
pageFrom
=
(
that
.
pageTo
-
that
.
limit
)
+
1
;
}
that
.
ui
.
pageRecordText
.
html
(
"Showing <u>"
+
that
.
searchCollection
.
models
.
length
+
" records</u>, from "
+
that
.
pageFrom
+
" - "
+
that
.
pageTo
);
if
(
that
.
offset
<
that
.
limit
&&
that
.
pageFrom
<
26
)
{
that
.
ui
.
previousData
.
attr
(
'disabled'
,
true
);
}
if
(
that
.
searchCollection
.
models
.
length
===
0
)
{
that
.
offset
=
that
.
offset
-
that
.
limit
;
}
}
that
.
renderTableLayoutView
();
if
(
value
)
{
var
resultArr
=
[];
if
(
that
.
searchCollection
.
queryParams
.
typeName
)
{
resultArr
.
push
(
that
.
searchCollection
.
queryParams
.
typeName
)
...
...
@@ -306,7 +293,7 @@ define(['require',
searchString
+=
"<p>If you do not find the entity in search result below then you can"
+
'<a href="javascript:void(0)" data-id="createEntity"> create new entity</a></p>'
;
}
that
.
$
(
'.searchResult'
).
html
(
searchString
);
}
},
silent
:
true
,
reset
:
true
...
...
@@ -611,8 +598,9 @@ define(['require',
$
.
extend
(
this
.
searchCollection
.
queryParams
,
{
offset
:
that
.
offset
});
this
.
previousClick
=
false
;
this
.
fetchCollection
({
paginationChange
:
true
});
this
.
fetchCollection
(
null
,
{
next
:
true
});
},
onClickpreviousData
:
function
()
{
var
that
=
this
;
...
...
@@ -621,8 +609,9 @@ define(['require',
$
.
extend
(
this
.
searchCollection
.
queryParams
,
{
offset
:
that
.
offset
});
this
.
previousClick
=
true
;
this
.
fetchCollection
({
paginationChange
:
true
});
this
.
fetchCollection
(
null
,
{
previous
:
true
});
},
onClickEditEntity
:
function
(
e
)
{
...
...
@@ -663,7 +652,7 @@ define(['require',
}
else
{
$
.
extend
(
this
.
searchCollection
.
queryParams
,
{
limit
:
this
.
limit
,
excludeDeletedEntities
:
true
});
}
this
.
fetchCollection
(
this
.
value
,
e
.
target
.
checked
);
this
.
fetchCollection
();
}
});
return
SearchResultLayoutView
;
...
...
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