jQWidgets Forums
Forum Replies Created
-
Author
-
November 7, 2012 at 2:54 pm in reply to: Context menu on listBox element Context menu on listBox element #10638
Thanks a lot. It works like I intended it to.
November 6, 2012 at 3:09 pm in reply to: Listbox doesn't populate from mysql with php Listbox doesn't populate from mysql with php #10604Sorry about not letting you know (forgot about this post, since I’ve made a bunch), but I’ve figured it out. It works fine now, thank you.
November 2, 2012 at 11:21 am in reply to: Append jqxGrid to jqxPanel? Append jqxGrid to jqxPanel? #10455Didn’t know that clearcontent removes the entire DIV. It works as it should now.
Thank you so much! You’ve been a great help.November 1, 2012 at 1:22 pm in reply to: Append jqxGrid to jqxPanel? Append jqxGrid to jqxPanel? #10410Tried it. In the php I echo “set” if selItemObl is set. The first time I select that variable is passed and the response I get is “set”. However,
the second time it doesn’t work. I checked with firebug and it seems there is no GET request like the first time. So, no request and because of that no response.November 1, 2012 at 12:51 pm in reply to: Append jqxGrid to jqxPanel? Append jqxGrid to jqxPanel? #10403I see. Changed that code to this:
processdata: function (data) { data.selItemObl = item3; if (data.selItemObl) data.selItemObl = data.selItemObl.id; else data.selItemObl.id = 0; }
The if…else statement ensures that I will send id. But it still doesn’t work. Also, I have tried with just data.selItemObl = item3.id;
October 31, 2012 at 2:16 pm in reply to: Append jqxGrid to jqxPanel? Append jqxGrid to jqxPanel? #10303I have another problem. Hope it’s ok to post here again…
I have several elements (2 trees and 2 listboxes). On select event of those elements I need to append a different grid, which in turn loads different data from a mysql database. The grids append and show data correctly, but only once.
Here’s how I do it (one of 2 trees, it’s similiar for the rest):$('#problemiTree').bind('select', function (event) { dataAdapter4.dataBind(); var item3 = $('#problemiTree').jqxTree('getSelectedItem'); var sourceGridOblast ={ datatype: "json", async:false, datafields: [{ name: 'Naziv' }, { name: 'NadOblast' }, { name: 'Opis' }], url: 'gridData.php', processdata: function (data) { data.selItemObl = item3; if (data.selItemObl) data.selItemObl = data.selItemObl.id; else data.selItemObl = 0; } }; var dataAdapterSourceGridOblast = new $.jqx.dataAdapter(sourceGridOblast); var jqxgridOblastOptions ={ source: dataAdapterSourceGridOblast, theme: 'classic', columns: [{ text: 'Naziv',datafield: 'Naziv', width: 150 }, { text: 'Nadoblast', datafield: 'NadOblast', width: 150 }, { text: 'Opis', datafield: 'Opis', width: 400 }] }; $('#svojstvaPanel').jqxPanel('clearcontent'); $('#svojstvaPanel').jqxPanel('append', $("#grid3")[0]); $("#grid3").jqxGrid(jqxgridOblastOptions); });
The problem is that no variable is passed using processData. I’ve tried using dataAdapterSourceGridOblast.dataBind() in that event (defined the source and created the adapter on document ready but it didn’t solve my problem).
Thanks.October 28, 2012 at 1:45 pm in reply to: Append jqxGrid to jqxPanel? Append jqxGrid to jqxPanel? #10125Thanks again. It works. The problem was in my php code…
October 26, 2012 at 11:59 am in reply to: Append jqxGrid to jqxPanel? Append jqxGrid to jqxPanel? #10071Ok, it seems I have to do it with options like you said.
My code is now:var sourceGridTest ={ datatype: "json", datafields: [{ name: 'Naziv' }, { name: 'Trajanje' }, { name: 'Predmet' }, { name: 'SablonId' }, { name: 'KriterijumTesta' }, { name: 'DatumPripreme'}, { name: 'DatumIzrade'}, { name: 'Stanje'}], url: 'gridData.php' }; var dataAdapterSourceGridTest = new $.jqx.dataAdapter(sourceGridTest, { downloadComplete: function (data, status, xhr) { }, loadComplete: function (data) { }, loadError: function (xhr, status, error) { } });
var sourceGridProblem ={ datatype: "json", datafields: [{ name: 'Naziv' }, { name: 'Opis' }, { name: 'Oblast' }, { name: 'VrstaProblema' }, { name: 'Odgovor' }, { name: 'Tezina'}, { name: 'Autor'}, { name: 'Komentar'}, { name: 'DatumPripreme'}, { name: 'StanjeUTestu'}, { name: 'Tacno'}, { name: 'Netacno'}, { name: 'Izostavljen'}, { name: 'Vise'}], url: 'gridData.php' }; var dataAdapterSourceGridProblem = new $.jqx.dataAdapter(sourceGridProblem, { downloadComplete: function (data, status, xhr) { }, loadComplete: function (data) { }, loadError: function (xhr, status, error) { } }); var jqxgridProblemOptions ={ source: sourceGridProblem, theme: 'classic', columns: [{ text: 'Naziv',datafield: 'Naziv', width: 150 }, { text: 'Trajanje', datafield: 'Trajanje', width: 75 }, { text: 'Predmet', datafield: 'Predmet', width: 120 }, { text: 'Sablon', datafield: 'SablonId', width: 70 }, { text: 'Kriterijum Testa', datafield: 'KriterijumTesta', width: 120 }, { text: 'Datum Pripreme', datafield: 'DatumPripreme', width: 120 }, { text: 'Datum Izrade', datafield: 'DatumIzrade', width: 130 }, { text: 'Stanje', datafield: 'Stanje', width: 120 }] } var jqxgridTestOptions ={ source: sourceGridTest, theme: 'classic', columns: [{ text: 'Naziv',datafield: 'Naziv', width: 150 }, { text: 'Trajanje', datafield: 'Trajanje', width: 75 }, { text: 'Predmet', datafield: 'Predmet', width: 120 }, { text: 'Sablon', datafield: 'SablonId', width: 70 }, { text: 'Kriterijum Testa', datafield: 'KriterijumTesta', width: 120 }, { text: 'Datum Pripreme', datafield: 'DatumPripreme', width: 120 }, { text: 'Datum Izrade', datafield: 'DatumIzrade', width: 130 }, { text: 'Stanje', datafield: 'Stanje', width: 120 }] };
For testing:
if (3<0) { $('#svojstvaPanel').jqxPanel('clearcontent'); $('#svojstvaPanel').jqxPanel('append', $("#jqxgridTest")[0]); $("#grid1").jqxGrid(jqxgridTestOptions); } else { $('#svojstvaPanel').jqxPanel('clearcontent'); $('#svojstvaPanel').jqxPanel('append', $("#jqxgridProblem")[0]); $("#grid2").jqxGrid(jqxgridProblemOptions); }
I’ve used a condition to enter ‘else’ branch but grid2 doesn’t show. Grid1 shows fine.
Here’s the panel and grids:
<div class="splitter-panel"> Svojstva <div id="svojstvaPanel"> </div> </div> <div id="grid1"> </div> <div id="grid2"> </div>
October 26, 2012 at 11:22 am in reply to: Append jqxGrid to jqxPanel? Append jqxGrid to jqxPanel? #10070Hm, so it doesn’t work if I initialize before if…else like this:
$("#jqxgridTest").jqxGrid({ source: sourceGridTest, theme: 'classic', columns: [{ text: 'Naziv',datafield: 'Naziv', width: 150 }, { text: 'Trajanje', datafield: 'Trajanje', width: 75 }, { text: 'Predmet', datafield: 'Predmet', width: 120 }, { text: 'Sablon', datafield: 'SablonId', width: 70 }, { text: 'Kriterijum Testa', datafield: 'KriterijumTesta', width: 120 }, { text: 'Datum Pripreme', datafield: 'DatumPripreme', width: 120 }, { text: 'Datum Izrade', datafield: 'DatumIzrade', width: 130 }, { text: 'Stanje', datafield: 'Stanje', width: 120 }] });
$("#jqxgridProblem").jqxGrid({ source: sourceGridProblem, theme: 'classic', columns: [{ text: 'Naziv',datafield: 'Naziv', width: 150 }, { text: 'Trajanje', datafield: 'Trajanje', width: 75 }, { text: 'Predmet', datafield: 'Predmet', width: 120 }, { text: 'Sablon', datafield: 'SablonId', width: 70 }, { text: 'Kriterijum Testa', datafield: 'KriterijumTesta', width: 120 }, { text: 'Datum Pripreme', datafield: 'DatumPripreme', width: 120 }, { text: 'Datum Izrade', datafield: 'DatumIzrade', width: 130 }, { text: 'Stanje', datafield: 'Stanje', width: 120 }] });
I do it like that because I have 2 different sources. The reason for that is that I have to get different data from a mysql database based on what the user selects.
October 24, 2012 at 1:40 pm in reply to: Listbox doesn't populate from mysql with php Listbox doesn't populate from mysql with php #9999I’ll try that. Thanks.
Edit: I’m already echoing JSON and checking by a direct link to the php file. Everything seems to be in order because JSON data is there.
That confirms that data really is getting to the client, right?October 24, 2012 at 11:40 am in reply to: Append jqxGrid to jqxPanel? Append jqxGrid to jqxPanel? #9976Thanks, but I still have a problem.
I’ve added:<div id="jqxgridTest"> </div> <div id="jqxgridProblem"> </div>
Similiar to yours, but when I have that piece of code both grids are shown. When I comment it I get neither of the grids.
This is how I append:if (true) { $('#svojstvaPanel').jqxPanel('clearcontent'); $('#svojstvaPanel').jqxPanel('append', $("#jqxgridTest")[0]); } else { $('#svojstvaPanel').jqxPanel('clearcontent'); $('#svojstvaPanel').jqxPanel('append', $("#jqxgridProblem")[0]); }
October 23, 2012 at 9:24 am in reply to: Grid with headers ordered in rows Grid with headers ordered in rows #9929Thank you for the quick reply.
-
AuthorPosts