My Cairn Terrorist has the same problem. Called a subluxing patella. I thought he would need an operation. Luckily for us my best mate is an (equine) vet and she suggested that we keep him REALLY quiet for a couple of weeks. NO jumping, walking only on a short leash. In his crate if he wasn't being supervised etc. It was a horrible 2 weeks. We had to lift him onto lounge and up stairs etc and it was very hard to confine a dog just because he'd had a slight intermittent limp.
It worked! My little Terrorist didn't talk to me for a while but he didn't need an operation. The joint is no longer 100% but the vet checks it each time we take him in or if we take our other dog for something else we get him checked at the same time. Sometimes he puts it down badly and limps so we just confine him to rest it.
My dog is 4 years old and the vet tells me he might need an operation when he's older but we've certainly made him comfortable for now.
Perhaps you could find out from a vet if your dog's leg is not too far gone if you could try this. There is a good dog athritis medication called Cartrophen which can help as the dog gets older with arthritis symptoms.
If you decide to go ahead with the surgery make sure you are fully informed and the vet who is doing it is very experienced. Our vet (obviously not the equine one) sends clients to another local vet who is highly experienced with the operation.
Hope this helps.
Kate