How to set symbol levels/ordering with renderers?

When I'm using a esri javascript renderer on a dynamic map service (e.g. ClassBreaksRenderer or UniqueValueRenderer), is there any way to set the symbol levels (i.e. drawing order) for each break/value?

I do not know of any support for symbol levels in the JS API renderers. ArcGIS Server has this ability because the image for the layer is rendered on the server using ArcObjects that has this ability. One workaround I can think of is to add a layer for each level (with a definition query applied) with the symbology you want and add each layer to the map in the priority order you are wishing to see.

Yeah, I thought about that too, but that would get real messy. Right now I've already got 28 layers on the map service, and that would mean splitting it into 112+ layers. The dataset is large and is on the slow side to render as it is, so I'm thinking this would probably slow it down even more.

Do you think it might be accomplished with SOEs/SOIs on ArcGIS Server?

Very probable. I don't have any experience with that though. Why would you need to split all your layers?.. are you not just concerned about the drawing order of this one that you want to symbolize in code on the client? Can't you let ArcGIS Server handle the others.

Ah yeah, it's complicated. The 28 existing sublayers are so the user can set custom breakpoints for the renderer for 28 different region/type combinations. For example, Region 1, Type A, set breakpoints to [0, 1, 2, 3]; Region 1, Type B, set breakpoints to [2, 3, 4, 5]; Region 2, Type A, set breakpoints to [2, 3, 6, 8]; etc. Each region/type combination has it's own dynamically-set set of breakpoints, but in the overall view of the map, it's the same 4 symbols everywhere.

Well, I thought that you might be able to add the additional layers at runtime for the specific layer that was being configured but that does not seem like an option. Good luck on this complicated app. I hope the LOE is worth what you are going get out of this.