It takes about 8-10 days for a normal cycle-tourist, of the ca 90km a day variety, to cycle from Bodo to Trondheim, (using Kystriksveien coastal route plus any adjustments that look nice to you) so in a 2 week tour you don't have time to explore Lofoten/Vesteralen and cycle to Trondheim. I once had a 3-week tour, starting a bit more sensibly at Harstad-Narvik-Evenes Airport and cycled up to the top of Vesteralen, then back down through Lofoten, across to Bodo on the ferry, and down to Trondheim, and had just a day to explore Trondheim before flying home.
On the other hand, there is a railway from Bodo to Trondheim, the http://en.wikipedia.org/wiki/Nordland_Line, so you can cycle around a bit, then finally when you run out of time transport yourself towards the railway and get a train to Trondheim. You will need to get separate advice on the need to book in advance at this time of year and the transportability of bikes on this railway. You can even get off the train at Hell 30km before Trondheim, being adjacent to Trondheim Airport (it would have been more fun if it was called Hell Airport, but one can understand why it instead was called Vaernes).
It is entirely plausible to cross from Bodo to Lofoten, cycle up through the Vesteralen islands, cross back over to the mainland and cycle back down via the mainland to Bodo. I know cyclists who have done this as a 2-week tour. Though immediately to the north of Fauske, on the final approach to Bodo, you'll have difficulty avoiding the E6 main road for quite some distance, which will be tedious in view of the level of traffic, and possibly some tunnels that are closed to you. In general cyclists should avoid E6 because of the traffic and numerous tunnels closed to cyclists.