Instead of overwriting the core code in ZmZimletBase.js (and avoid that getting overridden when you upgrade), you can call the code to construct the tab directly in your zimlet for now.
Here is example code that you would call in your zimlet init() function to create the tab. Notice the index is being set as one of the params sent to addButton():
Code:
com_zimbra_example_simpletab_HandlerObject.prototype.init =
function() {
var label = "Simple Tab App";
var image = "zimbraIcon";
var tooltip = "A simple app in a new tab";
var index = 2;
var params = {
text:label,
image:image,
tooltip:tooltip,
index:index
};
AjxDispatcher.require("ZimletApp");
var appName = [this.name, Dwt.getNextId()].join("_");
var controller = appCtxt.getAppController();
var appChooser = controller.getAppChooser();
appChooser.addButton(appName, params);
var app = new ZmZimletApp(appName, this, DwtShell.getShell(window));
controller.addApp(app);
this._simpleAppName = appName
}
We have filed and are making this enhancement to add support for setting the index when creating the tab. This will become available with ZCS 6.0.6 and when that happens, you can return to using ZmZimletBase.createApp() and optionally specify an index (vs. using the code above):
Bug 44720 – Tab Zimlet support for index