RulesEditor for habpanel

https://community.openhab.org/t/template-widget-tutorial-examples-make-your-own-widget/14211/190

Creating new topic for @Meghana_N question regarding providing Ruleseditor functionality in habpanel.

From the sourcecode of habpanel, each widget is calling getItems() function to load items as below.

WidgetSettingsCtrlLabel.$inject = [’$scope’, ‘$timeout’, ‘$rootScope’, ‘$uibModalInstance’, ‘widget’, ‘OHService’];

function WidgetSettingsCtrlLabel($scope, $timeout, $rootScope, $modalInstance, widget, OHService) {
    $scope.widget = widget;
    $scope.items = OHService.getItems();

    $scope.form = {
        name: widget.name,
        sizeX: widget.sizeX,
        sizeY: widget.sizeY,
        col: widget.col,
        row: widget.row,
        background: widget.background,
        foreground: widget.foreground,
        font_size: widget.font_size

};

@Meghana_N, you need to add code as in reloadItems function (registed in openhab.service.js file) (internally calls loadItems) which is called while dashboard display as below.

1 Like

You can see Custom widget setting for item-picker.

<item-picker ng-switch-when="item" ng-model="form.config[setting.id]"></item-picker>