GithubHelp home page GithubHelp logo

phuhn / nsg.primeng Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 2.0 313 KB

NSG.PrimeNG.LazyLoading is a project in support of TurboTable lazy and filter features. This allows for server-side/remote pagination, filtering and sorting.

License: MIT License

C# 100.00%
primeng angular csharp iqueryable c-sharp

nsg.primeng's Introduction

NSG.PrimeNG

Overview

This solution contains .Net Standard projects as follows:

  • A collection of support functions for PrimeNG (NSG.Library.PrimeNG)

The libraries

NSG.PrimeNG.LazyLoading

NSG.PrimeNG.LazyLoading is a project in support of TurboTable lazy and filter features. This allows for remote pagination, filtering and sorting using a .Net MVC API.

Example from original LazyLoadEvent unit tests:

    string _jsonString =
            "{\"first\":0,\"rows\":3," +
            "\"sortOrder\":-1,\"sortField\":\"NoteTypeSortOrder\"," +
            "\"filters\":{\"NoteTypeDesc\":{\"value\":\"SO\",\"matchMode\":\"StartsWith\"}}}";
    JavaScriptSerializer _js_slzr = new JavaScriptSerializer();
    LazyLoadEvent _loadEvent = (LazyLoadEvent)_js_slzr.Deserialize(_jsonString, typeof(LazyLoadEvent));
    List<NoteType> _rows = NoteTypes.AsQueryable()
            .LazyOrderBy(_loadEvent)
            .LazyFilters(_loadEvent)
            .LazySkipTake(_loadEvent).ToList();

The PrimeNG definition of LazyLoadEvent is wrong. What is returned from the lazy interface event for the filter is not a single FilterMetadata, but an array of FilterMetadata. It allows for 'or' conditional on the element being filtered. See github issue 10055 or my issue 10269.

Example of corrected LazyLoadEvent2 interface test:

    string _jsonString = "{\"first\":0,\"rows\":3," +
        "\"sortOrder\":-1,\"sortField\":\"NoteTypeSortOrder\"," +
        "{\"filters\":{\"NoteTypeDesc\":[" +
        "{\"value\":\"SO\",\"matchMode\":\"startsWith\",\"operator\":\"or\"}," +
        "{\"value\":\"6\",\"matchMode\":\"contains\",\"operator\":\"or\"}]}}";
    LazyLoadEvent2 _loadEvent = JsonConvert.DeserializeObject<LazyLoadEvent2>(_jsonString);
    List<NoteType> _rows = NoteTypes.AsQueryable()
        .LazyOrderBy2<NoteType>(_loadEvent)
        .LazyFilters2<NoteType>(_loadEvent)
        .LazySkipTake2<NoteType>(_loadEvent).ToList();

NSG.PrimeNG.LazyLoading_Tests

NSG.PrimeNG.LazyLoading_Tests is a .Net Core project of unit tests for the LazyLoading library.

Docs

The Sandcastle project files for creating HTML compiled help files.

Wiki

The Wiki pages were initialy created by the CS2Wiki.awk scripts with the library's XML file. The AWK scripts is a hack and got me 70% of the way to creating the MediaWiki file. Make sure the text is flush left except for code. Code is indented by two spaces. The mediwiki scripts have been moved here.

Check the Wiki pages for more information:

Primefaces

PrimeNG links:

nsg.primeng's People

Contributors

phuhn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sralco uniontrack

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.