Two things.
Firstly, the potenentiometer would be connected like this.
Wiper - pin 10
one end - ground
other end - ouput of the regulator
Secondly, that is not a good way of doing the voltage adjustment. It will be very non-linear, and you can also get large output voltages.
The better way is to use the circuit on page 7 of the data sheet, and make R2 a variable resistor. R1 is fixed. That way the adjustment goes from 1.23V up to whatever maximum you want (using the formula on that page) and it will be linear.
To use a potentiometer as a variable resistor, just connect to the wiper and one end. If the voltage goes up when you turn it down, connect to the other end instead.