Encounter with Ex

My computer has been on the fritz for ages now and I just got it back, fixed and ready to go.  I have tried to go on site when I have a few minutes at work but it is not the same as being able to peruse at my leisure.
On Saturday I was at the mall with my kids and while walking a long I saw my N ex from last summer who I haven't seen since September of last year.  I know he saw me.  He had this little smirk on his face as he walked straight past me and my kids (whom by the way he had known too) like he had no idea who we were.   
My heart started beating like a jackhammer and I was shaking.  I was outraged and upset and finished shopping distractedly.  By the time I got home I had purchased ice cream and ended up spending the evening crying.  I was ignored by him again.  I was the one who was supposed to be superconfident and look at him like he was a piece of dirt and walk right past him but instead I am feeling like dirt again. 
All my newfound confidence just dissolved in a fizzle and I am wondering why I am doing all this hard work if nothing is every going to change with me.  Why can't I just believe in myself?  Why do I think my worth is tied to whether a guy pays attention to me or not?  Will I ever be that confident girl I want to be?
I am so depressed today because I feel like I'm trapped inside myself and I don't know how to get out.
I'm reading books on narcissists, self-esteem, sprirituality, love addiction, anything I can get my hands on. 
One trigger and I'm back in the fetal postiion backing away from the world again. 
I'm scared that I won't be able to change.  I wish I could crawl out of my skin when I feel this way.  I just feel so pathetic.  Needy and insecure and clingy.  Like I am not worth anyone's time or love.  This "not good enough" feeling is always lingering inside me waiting to take over.  I don't care if no one else in the world belives in me.  I just want to find a way to believe in myself.