Can i Merge two different CSqlDataProvider (dataproviders) into one? if possible Please help me! I search but found only merging of criteria which is NOT working for me!.
thank
Burhan
Page 1 of 1
Merging Csqldataprovider Into One Based On Common Column
#2
Posted 25 April 2013 - 02:53 AM
Are you making an UNION between sql provider?
Yii2 by example: my book about Yii2
https://www.packtpub...nt/yii2-example
https://www.packtpub...nt/yii2-example
#3
Posted 25 April 2013 - 11:47 PM
Fabrizio Caldarelli, on 25 April 2013 - 02:53 AM, said:
Are you making an UNION between sql provider?
thanks for reply, i m not making UNION BUT i want to merge two data provider: my problems is "
I have to show the result of data which is filter and full and comparion with them in cgridview
id
filterData:
Percentage:
fullData:
etc
"
I had the problem in writing SQL(like having both inlist and all !!) query,so i was thinking if we can merge the dataproviders, then it easy then!!
#4
Posted 26 April 2013 - 01:53 AM
With a problem of this type, i've subclassed CGridView and then rendered footer's cell with specific method
to display correctly result of data.
Anyway, you could try to use GROUP BY .... WITH ROLLUP function (if you are using MySQL for example) at the end of sql,
but i don't know your sql to say that this could be implemented easily.
to display correctly result of data.
Anyway, you could try to use GROUP BY .... WITH ROLLUP function (if you are using MySQL for example) at the end of sql,
but i don't know your sql to say that this could be implemented easily.
Yii2 by example: my book about Yii2
https://www.packtpub...nt/yii2-example
https://www.packtpub...nt/yii2-example
#5
Posted 26 April 2013 - 02:02 AM
Fabrizio Caldarelli, on 26 April 2013 - 01:53 AM, said:
With a problem of this type, i've subclassed CGridView and then rendered footer's cell with specific method
to display correctly result of data.
Anyway, you could try to use GROUP BY .... WITH ROLLUP function (if you are using MySQL for example) at the end of sql,
but i don't know your sql to say that this could be implemented easily.
to display correctly result of data.
Anyway, you could try to use GROUP BY .... WITH ROLLUP function (if you are using MySQL for example) at the end of sql,
but i don't know your sql to say that this could be implemented easily.
thanks for reply
#6
Posted 27 April 2013 - 12:57 AM
fburhan89, on 25 April 2013 - 01:12 AM, said:
Can i Merge two different CSqlDataProvider (dataproviders) into one? if possible Please help me! I search but found only merging of criteria which is NOT working for me!.
thank
Burhan
thank
Burhan
I've once did a similar task: I needed a custom data provider that gets data from two sources. Basically, I've created a custom class that extends CDataProvider. This class implemented the following methods in order to achieve what I needed to override __construct(), fetchData(), fetchKeys(), calculateTotalItemCount() plus write several custom methods.
I suggest that if you cannot escape your need that you 'dive into' CDataProvider and create your own custom one.
Therapeutic PHP sessions My LinkedIn Profile
Share this topic:
Page 1 of 1