jqGrid - sorting won't work when datatype:local (jsFiddle included) - arrays

I couldn't find any solution.
I want to load my data from a local array. When I use the same settings in a different grid with datatype:json, from server, everything works fine.
But here I need a local array, I use data option. array is in format:
[[x,y,z], ...]
JSFIDDLE:
http://jsfiddle.net/7osga648/
CODE:
$("#datagrid1").jqGrid({
datatype:'local',height:350,width:400,gridview:true,rownumbers:true,rowNum:1000,viewrecords:true,
colNames:["time","col1","col2"],
colModel:[
{name:'time',width:150,resizable:false,sorttype:'date',datefmt:"d/m/Y H:i:s"},
{name:'f1',width:100,resizable:false,sorttype:'number'},
{name:'f2',width:100,resizable:false,sorttype:'number'}],
data:[["03/10/2014 20:46:27","60.8","2.5"],["03/10/2014 21:01:39","58.3","0.1"],["03/10/2014 21:16:51","61.3","3.4"],["03/10/2014 21:32:05","58.9","0.6"],["03/10/2014 21:47:18","58.7","0.8"],["03/10/2014 22:02:32","58.2","0.0"],["03/10/2014 22:17:45","61.9","3.8"],["03/10/2014 22:32:58","58.4","0.1"],["03/10/2014 22:48:11","60.0","2.1"],["03/10/2014 23:03:22","61.2","3.4"],["03/10/2014 23:18:34","62.0","3.8"],["03/10/2014 23:33:47","58.6","0.2"],["03/10/2014 23:49:00","58.4","0.2"],["04/10/2014 00:04:14","58.1","0.2"],["04/10/2014 00:19:28","58.1","0.2"],["04/10/2014 00:34:40","61.8","3.9"],["04/10/2014 00:49:51","58.9","0.6"],["04/10/2014 01:05:03","58.2","0.1"],["04/10/2014 01:20:16","61.2","3.4"],["04/10/2014 01:35:28","59.2","0.9"],["04/10/2014 01:50:40","58.4","0.1"],["04/10/2014 02:00:04","0","0"],["04/10/2014 02:05:52","61.8","3.7"],["04/10/2014 02:21:04","62.9","3.7"],["04/10/2014 02:36:15","63.1","3.5"],["04/10/2014 02:51:27","63.7","3.5"],["04/10/2014 03:06:40","60.1","0.0"],["04/10/2014 03:21:53","63.1","3.1"]],
localReader:{repeatitems:true,cell:""},
caption:"sorting not working. click on col header"
});
Try to click on column header, and see that nothing is happening.
Any idea?

I posted already the bug fix here. The modified demo "jsfiddle.net/7osga648/4/" uses directly the new features. See the answer for additional information.

Related

Want to pass in a string array into a WS.sendRequest using groovy

I am new to API testing and am using Katalon to develop the tests. I've Googled any question I could think of and couldn't find anything to answer my question.
We have an API with the following Body
[
"${idValue1}",
"${idValue2}",
"${idValue3}",
"${idValue4}",
"${idValue5}",
]
I believe the purpose of this one is to delete multiple records at once by id. The script that we have in the step definition is
response = WS.sendRequest(findTestObject('EquipmentAPI/data-objects/DELETE Equipment By Ids', [('host') : GlobalVariable.host, ('idValues') : GlobalVariable.equipId]))
GlobalVariable.equipId = WS.getElementPropertyValue(response, 'data[0].id')
There are other step definitions that run before this one to set the Global Variables for use. I was able to generate the string array without issue.
Is this something that's possible? Please help!
Please let me know if further information is needed. Thanks.

Displaying Parse Data to ContainerList

I want to display data from Parse in a list from GamesScores class using Container in Codename One, this is what I've tried so far and it's not showing anything nor giving any errors:
Container container = findListCont();
container.setLayout(BoxLayout.y());
container.setScrollableY(true);
ParseQuery<ParseObject> query = ParseQuery.getQuery("GameScore");
List<ParseObject> results = (List<ParseObject>) query.find();
System.out.println("Size: " + results.size());
container.addComponent(results, f);
Please help me out, I'm a new in Codename One. If there tutorials on it, please share or anything to help me achieve the desired results.
I'm actually shocked this isn't failing. You are using the add constraint to place the object result as a constraint and you add the form object into the container...
You need to loop over the results and convert them to components to add into the layout. It also seems that you are using the old GUI builder which I would recommend against.
Generally something like this rough pseudo code should work assuming you are using a box Y layout:
for(ParseObject o : results) {
MultiButton mb = new MultiButton(o.getDisplayValue());
f.add(mb);
}
f.revalidate();

Setting array equal to JSON array - Xcode

I'm trying to figure out how to populate a table from a JSON array. So far, I can populate my table cells perfectly fine by using the following code:
self.countries = [[NSArray alloc]initWithObjects:#"Argentina",#"China",#"Russia",nil];
Concerning the JSON, I can successfully retrieve one line of text at a time and display it in a label. My goal is to populate an entire table view from a JSON array. I tried using the following code, but it still won't populate my table. Obviously I'm doing something wrong, but I searched everywhere and still can't figure it out:
NSURL *url = [NSURL URLWithString:#"http://BlahBlahBlah.com/CountryList"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON)
{
NSLog(#"%#",[JSON objectForKey:#"COUNTRIES"]);
self.countries = [JSON objectForKey:#"COUNTRIES"];
}
failure:nil];
[operation start];
I am positive that the data is being retrieved, because the NSLog outputs the text perfectly fine. But when I try setting my array equal to the JSON array, nothing happens. I know the code is probably wrong, but I think I'm on the right track. Your help would be much appreciated.
EDIT:
This is the text in the JSON file I'm using:
{
"COUNTRIES": ["Argentina", "China", "Russia",]
}
-Miles
It seems that you need some basic JSON parsing. If you only target iOS 5.0 and above devices, then you should use NSJSONSerialization. If you need to support earlier iOS versions, then I really recommend the open source JSONKit framework.
Having recommended the above, I myself almost always use the Sensible TableView framework to fetch all data from my web service and automatically display it on a table view. Saves me a ton of manual labor and makes app maintenance a breeze, so it's probably something to consider too. Good luck!

Help with atk4-web, atk4-example ver. 4.03

I don't now where can I find help. None forums about atk4.
Can you help me, please?
atk4-web (4.0.3):
How run atk4-web localy, where is site dump (mysql database)?
What is mean this error:
No such tag (version) in template for Object AgileToolkitWeb(agile_project). Tags are: page_title, page_title#1, seo_keywords, seo_keywords#2, seo_descr, seo_descr#3, template, template#4, template#5, template#6, template#7, template#8, template#9, os, os#10, js_include, js_include#11, document_ready, document_ready#12, section, section#13, template#14, menu_about, menu_about#15, page, page#16, menu_doc, menu_doc#17, page#18, menu_develop, menu_develop#19, page#20, menu_services, menu_services#21, page#22, menu_download, menu_download#23, page#24, menu_blog, menu_blog#25, page#26, link_comparison, link_comparison#27, link_example, link_example#28, link_tour, link_tour#29, Content, Content#30, TabContent, TabContent#40
D:\Www\atk4web\atk4\lib\SMlite.php:341
atk4-example (4.0.3):
Why page has not javascrip included, when I allow ->check() in Frontend?
What is difference between empty.html and shared.html?
empty.html:
shared.html:
Why I got error when I did change in empty.html to:
Thanks.
Agile Toolkit uses template engine called 'SMlite'. Its very basic and allows you to load template, then set tags to a certain value.
$tpl->trySet('mytag',123);
Views in Agile Toolkit rely on this template engine and will try to generate their output and place inside parent's template. In your case object was instructed to use spot which did not exist in the template.
Read section about adding here: http://agiletoolkit.org/doc/learn, it should be helpful.
There are no need for JavaScript on auth login form. It also bypasses some of the UI/functionality due to security reasons. You can either create your own empty.html by placing it into template/jui/empty.html (without atk4) and enable javascript in there.
Also sequence of adding jUI and executing auth->check() might change this, but I'm not sure.

How can I fix the unsecure_base_url on my Magento installation?

I've been having problems with uploading images and in trying to fix it, happened to change the base_url in the config which has now caused my website to appear without any styling at all (inc the Admin).
I've gone into phpMyAdmin and fixed the urls but i'm not having any luck. This is what i've got at the moment...
web/unsecure/base_link_url http://www.northwalesdoorworld.co.uk/
web/unsecure/base_skin_url http://www.northwalesdoorworld.co.uk/skin/
web/unsecure/base_media_url http://www.northwalesdoorworld.co.uk/media/
web/unsecure/base_js_url http://www.northwalesdoorworld.co.uk/js/
Could someone please take a look at my site - northwalesdoorworld.co.uk - and recommend a way to solve my problem?
thanks,
Greg.
if you can't access your site due that you can change the values directly in core_config_data table
SELECT * FROM core_config_data WHERE path LIKE '%web/unsecure%' or path LIKE '%web/secure%'
you can fix them by editing the values to be like clockworkgeek suggested or removing whole rows from database and they will be created over again by magneto and you can use the admin page to add new values.
Change the four values to:
{{unsecure_base_url}}
{{unsecure_base_url}}skin/
{{unsecure_base_url}}media/
{{unsecure_base_url}}js/
Empty var/cache/ in your magento folder.
Please refer to the most recent Magento wiki entry: http://www.magentocommerce.com/wiki/recover/restore_base_url_settings
You can also add something like this to /MAGENTO/app/etc/config.xml rather than manipulate the database:
<stores>
<default>
<web>
<unsecure>
<base_url>{{base_url}}</base_url>
<base_link_url>{{unsecure_base_url}}</base_link_url>
<base_web_url>{{unsecure_base_url}}</base_web_url>
<base_skin_url>{{unsecure_base_url}}skin/</base_skin_url>
<base_js_url>{{unsecure_base_url}}js/</base_js_url>
<base_media_url>{{unsecure_base_url}}media/</base_media_url>
</unsecure>
<secure>
<base_url>{{base_url}}</base_url>
<base_web_url>{{secure_base_url}}</base_web_url>
<base_link_url>{{secure_base_url}}</base_link_url>
<base_js_url>{{secure_base_url}}js/</base_js_url>
<base_skin_url>{{secure_base_url}}skin/</base_skin_url>
<base_media_url>{{secure_base_url}}media/</base_media_url>
</secure>
</web>
</default>
</stores>

Resources