0

working . seem 2 value in listview.

{"liste":{"TotalRecordCount":"2","xmlns":"","dokuman":[{"id":"2568","titles":"İstanbul Eindhoven"},{"id":"2384","titles":"Kesişen Dünyalar",}]}}

not working. not seem 1 value in listview

{"liste":{"TotalRecordCount":"1","xmlns":"","dokuman":{"id":"2085","titles":"Fotoğraf Atölyesi"}}}

my listview adding code

path=data.liste.dokuman;

for (var liindex = 0;liindex<path.length; liindex++){
   // my listview adding value
   }

if only record in json , listview not add so not add 1 record.

thanks.

2 Answers 2

1

Json should be in proper format if there may be more then one result in any Json array .
so your Json should be like this :

{"liste":{"TotalRecordCount":"1","xmlns":"","dokuman":[{"id":"2085","titles":"Fotoğraf Atölyesi"}]}} 

then your above code will work . Otherwise get the data in following way for single record JsonObject .

var id=data.liste.dokuman.id ;
var titles = data.liste.dokuman.id.titles;

and so on..

Sign up to request clarification or add additional context in comments.

Comments

0

work :) thanks @neeraj

if(path.length == undefined){
              myNewArray[0]= path;
              console.log("not array")
         }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.