This example shows how to load a grid with data from a WMS capabilities document. You can double-click on a row to see a map preview of the layer.
Note that the js is not minified so it is readable. See wmscapabilities.js.