Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was able to figure it out. I had to do four things:</p> <ol> <li>Update my version of angularjs (I was on 1.08 which does not have the <code>ng-if</code> directive). I updated to 1.2.0rc3.</li> <li>Wrap my <code>kendo-grid</code> <code>div</code> in an <code>ng-if</code> <code>div</code></li> <li><strong>Invoke</strong> my function! I was just setting <code>$scope.gridModel.options</code> <strong>to</strong> a function - I needed to actually invoke the function so I'd be setting the variable to the value returned <strong>from</strong> the function.</li> <li>I had to update my <code>angular.module</code> declaration to include <code>ngRoute</code> (based on it being separated into it's own module in 1.2.x).</li> </ol> <p>Here's the updated HTML:</p> <pre><code>&lt;div data-ng-if="contentAvailable"&gt; &lt;div kendo-grid k-options="{{gridModel.options}}" k-data-source="gridModel.myDataSource"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And here's the updated controller (not shown: I set <code>$scope.contentAvailable=false;</code> at the beginning of the controller):</p> <pre><code>// this is called after the api call has successfully returned with data function getSucceeded(){ ... $scope.gridModel.options = function(){ // function that dynamically builds options object with columns, etc. }(); // &lt;----- NEED to invoke function!! // this is just shown for example... the data is properly loading $scope.gridModel.myDataSource.data(ds.data()); $scope.contentAvailable=true; // trigger the ng-if } </code></pre> <p>I actually moved the function into a <code>config</code> file so I'm not polluting the controller with too much configuration code. Very happy to have figured this out.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload