# Is there a way to handle vis.\_editableVis in Kibana 6.x?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-handle-vis-editablevis-in-kibana-6-x/118332>\
**Category:** Kibana\
**Created:** [February 4, 2018, 8:29am UTC](https://discuss.elastic.co/t/is-there-a-way-to-handle-vis-editablevis-in-kibana-6-x/118332 "2018-02-04T08:29:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lynnic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lynnic/32/27427_2.png) [@Lynnic](https://discuss.elastic.co/u/Lynnic)\
**Post date:** [February 4, 2018, 8:29am UTC](https://discuss.elastic.co/t/is-there-a-way-to-handle-vis-editablevis-in-kibana-6-x/118332/1 "2018-02-04T08:29:32Z")

</div>

I am migrating a vis plugin from 5.x to 6.x  
here is the code that can not work in kibana 6.x

`

```
// $scope.searchSource.size($scope.vis.params.numberOfRowsToFetch)
    $scope.$watch('vis._editableVis.dirty', function(nv,ov){
        if(nv == false){
            $scope.searchSource.size($scope.vis.params.numberOfRowsToFetch);
            $scope.searchSource.fetchQueued();
        }
    });

```

`

In fact, **\_eitableVis** doe not exist in 6.x at all,  
what does **dirty** mean in here?

##### Two main questions:

1、Is there a way to achive same goal in 6.x as **\_editableVis** does in kibana 5.x?  
2、 **searchSource** does not exist as $scope's method anymore, is there any way to call it or create an new one ?

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [February 5, 2018, 4:50pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-handle-vis-editablevis-in-kibana-6-x/118332/2 "2018-02-05T16:50:55Z")

</div>

@thomasneirynck /@ppisljar any idea here ?

Thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [February 6, 2018, 3:18pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-handle-vis-editablevis-in-kibana-6-x/118332/3 "2018-02-06T15:18:15Z")

</div>

@Lynnic what is the above code trying to achieve ?

and is this code part of editor or part of actual visualization ?

the `vis._editableVis.dirty` indicated that there is a pending change in the editor (when set to true) which was not yet applied (the play button was not pressed).

if this code is part of visualization .... visualization really should not be checking what the editor is doing.

if the code is part of editor, then it would be good to know where in editor exactly ? but in general, the editor now stores the dirty flag directly on the vis (so `$scope.vis.dirty`)

again, visualization should not be checking that. when editor applies the changes visualizations `render` method will be called again with new data.

the other thing is the `searchSource` ... that is no longer available on visualization, as visualization should not be issuing requests on their own. It would be helpful to know what is the goal here, but in general, `requestHandler` is responsible for issuing requests to elasticsearch. If for some reason visualization really needs to query elasticsearch it can create a new searchSource by importing the `SearchSourceProvider` (take a look at `coordinate_maps_visualization.js`

---

<div class="post-metadata">

**Author:** ![Lynnic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lynnic/32/27427_2.png) [@Lynnic](https://discuss.elastic.co/u/Lynnic)\
**Post date:** [February 6, 2018, 3:33pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-handle-vis-editablevis-in-kibana-6-x/118332/4 "2018-02-06T15:33:14Z")

</div>

Thanks a lot for your replying @ppisljar  
We now have a scenario that when changing options panel and click apply button, it will send a query request  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/f/3f9e51e5996dc3292933338640cc67cf24a4b702.png)

It works fine in kibana 5.x  
now we have a migration for this plugin and facing several problems

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [February 6, 2018, 3:49pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-handle-vis-editablevis-in-kibana-6-x/118332/5 "2018-02-06T15:49:14Z")

</div>

if i understand correctly, you don't use the default editor (for building es request, like which aggregations to use) but implement your own ?

if that is the case, you should implement your own request handler. when clicking apply button your request handler will be called and you can make your request there. the response will then be passed to visualization which can use it.

1. no need to check the dirty status
2. no need to query from visualization

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 6, 2018, 3:49pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-handle-vis-editablevis-in-kibana-6-x/118332/6 "2018-03-06T15:49:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
