Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

What to pass to qvangular.promise()!?

Hello everyone,

Can someone kindly share an example of selectdialog.js    Note sure what to pass to qvangular.promise()

Many thanks

//Youness

2 Replies
Not applicable

Re: What to pass to qvangular.promise()!?

Hello Youness,

my solution looks like this:

selectdialog.js:

getPreview: function( /*databaseName, ownerName, tableName*/ ) {

return serverside.sendJsonRequest("getPreview").then(function (response) {

   return qvangular.promise(response.qPreview);

   });

}

On the serverside I'm using the Qvx SDK. In the QvxServer I'v overwritten the HandleJsonRequest, which is handling the JsonRequests.

   if (method.Equals("getPreview"))

   {

     var result = new PreviewResponse();

     // Store the table Header (my table has two columns)

     var row = new PreviewRow();

    row.qValues.Add("LayerId");

    row.qValues.Add("Layer");

   

     // Store the values

     row = new PreviewRow();

     row.qValues.Add("1");

     row.qValues.Add("Actual");

    

     row = new PreviewRow();

     row.qValues.Add("2");

     row.qValues.Add("Plan");

     return result;

   }

The PreviewResponseClass is defined like this:

   public class PreviewRow

   {

       public PreviewRow()

       {

            this.qValues = new List<string>();

       }

      public List<string> qValues { get; set; }

   }  

  

   public class PreviewResponse: QvDataContractResponse

  {

       public PreviewResponse(): base()

       {

            this.qPreview = new List<PreviewRow>();

       } 

       public List<PreviewRow> qPreview { get; set; }

   }

I hope that will help you.

Kind Regards,

Thorsten

Not applicable

Re: What to pass to qvangular.promise()!?

Hi Thorsten,

It was my pleasure talking to you the other day, sorry if it took me sometime to reply. I meant to thank you sincerely for sharing your implementation for both JS and .NET. Personally this reminds me of the west coast culture in CA, USA back in the 60s - 70s a culture that was built around open source, do it yourself and empowering others through knowledge sharing, thumb up.

Beams of Light by TRSI - YouTube

Cheers

// Youness

Community Browser