- Мое требование - сортировка объектов по цене. Основываясь на деньгах, объекты необходимо сортировать.
Ниже приведены образцы данных, которые я утешил, и получил и показал ниже.сортировать объект по цене с помощью jquery
С помощью утешителя full_sky.sort (test); я получаю данные ниже.
0: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 44499
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
1: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 2299
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
2: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 3399
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
Выход должен быть что-то вроде этого
1: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 2299
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
2: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 3399
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
0: Object
id: 1
test: Array[1]
0: Object
fuldata: "xyz"
pat: "xyz"
img: "6E.gif"
nos: "0 - stop"
show_price: 1
sour: "BLR"
tickettype: "e"
__proto__: Object
length: 1
__proto__: Array[0]
price: Array[1]
0: Object
cash: 44499
total_surcharge: 885
total_tax: 1414
__proto__: Object
length: 1
Что такое 'test' в' full_sky.sort (test) ' –
ответ от api, получаемый в виде json, присваивание данных переменным и нажатие на full_sky.push (test); – sivashanker