Author Topic: Customize the No rows to display message  (Read 5467 times)

argo

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 33
    • View Profile
Customize the No rows to display message
« on: August 21, 2014, 01:49:38 am »
Didn't see anything in the API to customize this. I've got multiple grids on the same page and need to identify the content type specifically when there aren't any rows. For example, initialize a grid so that when there are no rows it'll display "No events were found" without modifying the other grids on the same page.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Customize the No rows to display message
« Reply #1 on: August 21, 2014, 03:29:28 pm »
It's a localization string which can be modified for a single grid without affecting others on the same page by modifying the option

strNoRows

argo

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Customize the No rows to display message
« Reply #2 on: August 21, 2014, 06:21:24 pm »
Thanks. Is there a list of options that can be set that aren't officially documented in the api? I ask because I looked for this option in the api documentation first, assuming it might be there.  I didn't realize I could initialize the grid by passing in these options as well which is very helpful.

For anyone else, you can set the 'no rows to display' string at initialization like this:

var obj = {
     // all your other grid settings
     strNoRows : 'Nothing to show'
}
$("mydiv").pqGrid(obj);

I wanted to style it and had to explicitly pass in the css styles like this:

strNoRows : '<div style="font-size:18px;margin-top:20px;">Nothing to show</div>'

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Customize the No rows to display message
« Reply #3 on: August 21, 2014, 10:03:06 pm »
All the localization strings are there in localize folder.

Though the description of different ways they can be used is missing from docs, I would add them in the tutorial topic on localization.

http://paramquery.com/pro/tutorial#topic-locale