Web UI component: j-Empty


  • Info
  • HTML
  • JS
  • CSS
  • Meta

j-Empty

  • path must contain a data-source which will be watched

Configuration:

  • icon {String} a default icon (default: fa fa-database)
  • parent {String} a parent container which sets a minimal height (default: parent)
  • margin {Number} a margin (default: 0)
  • topoffset {Boolean} applies element.offset().top as a margin (default: false)
  • topposition {Boolean} applies element.position().top as a margin (default: false)

Use-case 1:

<div data---="empty__datasource" class="hidden">
    Items not found
</div>
<div class="hidden" data-bind="datasource__show:value && value.length"></div>

Use-case 2:

<div data---="empty__datasource" class="hidden">
    <script type="text/html">
        Items not found
    </script>
    <div>
        YOUR CONTENT. This DIV will be hidden automatically if the "datasource" is empty.
    </div>
</div>

Author