Pnpjs: Documentation: sp\items.html

Created on 23 May 2018  路  3Comments  路  Source: pnp/pnpjs

Please describe how we can improve the doc page:
Improvement is to this page:
https://pnp.github.io/pnpjs/sp/items.html, under Basic Get

It should be noted that orderBy can be used on multiple columns. The format would be:
.orderBy("ColumnName desc/asc, ColumnName", true/false)

The documentation didn't cover that. I knew odata supported multiple columns. You just need to include the sort order after the first column then comma second column, all in quotations as your first parameter.

I hope this helps.
Thanks,
Andy

documentation answered question

All 3 comments

Hey @GokuSSL5,

This is supported in PnPjs too for sure.
Multiple orderBy can be chained for this purposes like this:

.orderBy("ColumnName1", true).orderBy("ColumnName2", false)

Ok, gotcha! Didn't know chaining was supported on the same command. Didn't see it on the documentation page either.
Thanks for the update!

Closing this as answered. Thanks!

Was this page helpful?
0 / 5 - 0 ratings