Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions css/evolugrid.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.noMoreResults{
display: none;
font-style: italic;
text-align:center;
margin-top: 20px;
margin-bottom: 20px;
}
5 changes: 3 additions & 2 deletions js/evolugrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"fixedHeader": false,
"rowClick": false,
"noResultsMessage": "> No results are available <",
"noMoreResultsMessage": "> No more results <",
"chevronUpClass" : "icon-chevron-up glyphicon glyphicon-chevron-up",
"chevronDownClass" : "icon-chevron-down glyphicon glyphicon-chevron-down",
"loadOnInitPage":0
Expand Down Expand Up @@ -746,7 +747,7 @@

if (init) {
//construct no more results
var noMoreResultsDiv = $('<div>').html("> No more results <").addClass("noMoreResults").css({'display':'none', 'font-style':'italic', 'text-align':'center', 'margin-top':20, 'margin-bottom':20});
var noMoreResultsDiv = $('<div>').html(descriptor.noMoreResultsMessage).addClass("noMoreResults");
$this.append(noMoreResultsDiv);

if (descriptor.fixedHeader) {
Expand Down Expand Up @@ -880,4 +881,4 @@
o.find('thead.header-copy> tr > th:eq('+i+')').width(w)
});
};
})(jQuery);
})(jQuery);
51 changes: 39 additions & 12 deletions src/Mouf/Html/Widgets/EvoluGrid/EvoluGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class EvoluGrid implements HtmlElementInterface

/**
* Replaces the pagination by an infinite scroll.
*
*
* @var bool
*/
private $infiniteScroll = false;
Expand All @@ -77,7 +77,7 @@ class EvoluGrid implements HtmlElementInterface

/**
* Fixed the header of the evolugrid table.
*
*
* @var bool
*/
private $fixedHeader = false;
Expand All @@ -93,8 +93,8 @@ class EvoluGrid implements HtmlElementInterface
/**
* The search form that will be displayed just before the grid.
* If you want to put the search form somewhere else, you do not have to use this property.
* You can instead use the formSelector to point to a form anywhere on your page.
*
* You can instead use the formSelector to point to a form anywhere on your page.
*
* @var HtmlElementInterface
*/
private $searchForm;
Expand Down Expand Up @@ -155,6 +155,13 @@ class EvoluGrid implements HtmlElementInterface
*/
private $noResultsMessage;

/**
* Message to display if no more results are shown.
*
* @var ValueInterface|string
*/
private $noMoreResultsMessage = "> No more results <";

/**
* The selector name for the DOM element that will receive the number of results.
*
Expand Down Expand Up @@ -219,7 +226,7 @@ public function setLimit($limit)

/**
* The id of the evolugrid.
*
*
* @param string $id
*/
public function setId($id)
Expand All @@ -229,7 +236,7 @@ public function setId($id)

/**
* The class of the evolugrid.
*
*
* @param string $class
*/
public function setClass($class)
Expand All @@ -239,7 +246,7 @@ public function setClass($class)

/**
* Export the grid to CSV format.
*
*
* @param bool $exportCSV
*/
public function setExportCSV($exportCSV)
Expand All @@ -260,7 +267,7 @@ public function setInfiniteScroll($infiniteScroll)
/**
* The position of the row which will launch the ajax call for infinite scroll when scrolling (start by the end).
* if empty, the default value is 5.
*
*
* @param int $infiniteScroll_ElementPosition
*/
public function setInfiniteScrollElementPosition($infiniteScroll_ElementPosition)
Expand All @@ -281,7 +288,7 @@ public function setFixedHeader($fixedHeader)
/**
* CSS selector of the nav bar (to fix the evolugrid header just below).
* If empty, the header is fixed to the top of the window.
*
*
* @param string $fixedHeader_NavBarSelector
*/
public function setFixedHeaderNavBarSelector($fixedHeader_NavBarSelector)
Expand Down Expand Up @@ -310,7 +317,7 @@ public function setCountTarget($countTarget)

/**
* Enable the search history when the user click on the previous page button.
*
*
* @param bool $searchHistory
*/
public function setSearchHistory($searchHistory)
Expand Down Expand Up @@ -411,7 +418,7 @@ public function setCustomLoader($customLoader) {
$this->customLoader = $customLoader;
return $this;
}

/**
* @param string $onResultShown
*/
Expand Down Expand Up @@ -454,6 +461,24 @@ public function setNoResultsMessage($noResultsMessage)
$this->noResultsMessage = $noResultsMessage;
}

/**
* @return ValueInterface|string
*/
public function getNoMoreResultsMessage()
{
return $this->noMoreResultsMessage;
}

/**
* If not set, message to display if no more results are shown will be '> No more results <'
*
* @param ValueInterface|string $noMoreResultsMessage
*/
public function setNoMoreResultsMessage($noMoreResultsMessage): void
{
$this->noMoreResultsMessage = $noMoreResultsMessage;
}

/**
* @return bool
*/
Expand Down Expand Up @@ -514,6 +539,7 @@ public function toHtml()
$descriptor->searchHistoryAutoFillForm = $this->searchHistoryAutoFillForm;
$descriptor->rowCssClass = $this->rowCssClass;
$descriptor->noResultsMessage = ValueUtils::val($this->noResultsMessage);
$descriptor->noMoreResultsMessage = ValueUtils::val($this->noMoreResultsMessage);
$descriptor->countTarget = $this->countTarget;
if ($this->chevronUpClass) {
$descriptor->chevronUpClass = $this->chevronUpClass;
Expand Down Expand Up @@ -565,7 +591,7 @@ public function toHtml()
echo '<div class="ajaxLoader" style="text-align: center; background-color: black; width: 100%; height: 100%; position: absolute; top: 0; opacity: 0.3"><img src="'.ROOT_URL.'vendor/mouf/html.widgets.evolugrid/img/ajax-loader.gif" alt="ajax-loader" style="margin-top: -20px; position: absolute; top: 50%;"></div>';
}
}
echo '</div>
echo '</div>
<script type="text/javascript">
(function($) {
$(document).ready(function() {
Expand All @@ -591,6 +617,7 @@ public function toHtml()
});
})(jQuery);
</script>
<link rel="stylesheet" href="'.ROOT_URL.'vendor/mouf/html.widgets.evolugrid/css/evolugrid.css" />
';
}
}