Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 703
  • Last Modified:

Function is getting the following error:"1067: Implicit coercion of a value of type String to an unrelated type Number."

private function navigatePage(event:ItemClickEvent):void
                  {
                              var lb:String = event.item.label;
                              
                        if (event.label.indexOf("Next")>=0) {
                              var lastLabel = nav[event.index-1];
                              navPage = Number(event.label+1);
                        }
                       
                        else if (event.label.indexOf("Previous")>=0) {
                              var lastLabel = nav[event.index+1];
                              navPage = Number(event.label-1);
                        }
                       
                        else {
                              navPage = Number(event.label);
                        }
                        refreshDataProvider(event.item.data);
                       
                        if( lb.indexOf("<") > -1 || lb.indexOf(">") > -1 )
                        {
                              createNavBar(Math.ceil(orgData.length/pageSize),event.item.data);
                        }
                  }
0
DIGITALUnderworld
Asked:
DIGITALUnderworld
  • 4
  • 2
1 Solution
 
evcrCommented:
Try (event.label+1).toString()
0
 
DIGITALUnderworldAuthor Commented:
I need to build a pagination feature that displays like so:

<Previous  1-25 of 500 Next>
0
 
evcrCommented:
of a datagrid or what?
0
Who's Defending Your Organization from Threats?

Protecting against advanced threats requires an IT dream team – a well-oiled machine of people and solutions working together to defend your organization. Download our resource kit today to learn more about the tools you need to build you IT Dream Team!

 
DIGITALUnderworldAuthor Commented:
Yes, sorry.
0
 
DIGITALUnderworldAuthor Commented:
Found own solution
0
 
DIGITALUnderworldAuthor Commented:
Found own solution
0

Featured Post

Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now