U.S. President Donald Trump's namesake charitable foundation has agreed to dissolve under court supervision following a lawsuit by New York's attorney general claiming Trump misused the foundation to advance his 2016 presidential campaign and his businesses.