Hi I'm trying to develop a UI for an oracle table which has around 40 columns/fields using jquery datatbles plugin. I'm able to display upto 18 columns, but after that it's not working. Is anyone else faced the same issue before? Please advice me on this i'm pretty new with jquery.
`Sorry for that...
when i'm trying to create a UI for my oracle table, when i configure it for 18 columns(any 18) i can see my UI is working perfectly. But if i add one more column and update the configuration my UI is not loading.
<script type="text/javascript">
$(document).ready(function () {
$("#reports").dataTable({
"bServerSide": true,
"sAjaxSource": "/databaseInterface/DataSource",
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"aoColumns": [
{ "sName": "ID",
"bSearchable": false,
"bSortable": false,
"bVisible": false
},
{ "sName": "name" },
{ "sName": "sname" },
{ "sName": "address" },
{ "sName": "city" },
{ "sName": "post code" },
{ "sName": "age" },
{ "sName": "major" },
{ "sName": "grade" },
{ "sName": "Elect1" },
{ "sName": "Elect2" },
{ "sName": "Elect3" },
{ "sName": "Elect4" },
{ "sName": "Elect5" },
{ "sName": "Assig1" },
{ "sName": "Assig2" },
{ "sName": "Assig3" },
{ "sName": "Assig4" },
{ "sName": "Assig5" }
]
}).makeEditable({
"aoColumns": [
{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}
]
});
});
</script>
this is my sample code which is working properly, and is i add { "sName": "Status" } at the end, and update my datasource with the corresponding value it's not displaying aything in my UI.
`
jquery 1.8, java 5 and also jquery editable datable plugin
I'm trying to display my oracle table like a datatable shown in this website
datatable reference that i'm using
Very likely the problem is that your server is rejecting GET requests which have more than a certain number of characters. By default DataTables sends server-side processing requests as GET. To change to POST use the sServerMethod option - http://datatables.net/ref#sServerMethod .
Related
I need to make an api for stepfunctions but the problem is, how do I get the output of the first as input for the next?
Here is what I have so far:
{
"Comment": "Match",
"StartAt": "Search",
"States": {
"Search": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"Cluster": "Search-cluster",
"TaskDefinition": "Search-task",
"Overrides": {
"ContainerOverrides": [
{
"Name": "search",
"Command.$": "$.commands"
}
]
}
},
"Next": "Save"
},
"Save": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"Cluster": "save-cluster",
"TaskDefinition": "save-task",
"Overrides": {
"ContainerOverrides": [
{
"Name": "save",
"Command.$": "$.commands"
}
]
}
},
"Next": "Send"
},
"Send": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"Cluster": "send-cluster",
"TaskDefinition": "send-task",
"Overrides": {
"ContainerOverrides": [
{
"Name": "send",
"Command.$": "$.commands"
}
]
}
},
"End": true
}
}
}
I was facing the same issue and contacted AWS Support. Was told that it is not possible to directly return the result of a Fargate Task like you can do with Lambdas. One of the options is to store the result of your task in a separate DB like DynamoDB and write a Lambda to retrieve the value and update your input JSON with the output from the previous task.
Sidenote: In your ASL, you should look at using ResultPath. The default behaviour is to replace the input node with the output (result). Meaning, if in your input JSON you have values that you would like to use in subsequent states and if you don't specify ResultPath, they'd be lost after the first state. Ref: https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultpath.html#input-output-resultpath-amend
You don't have to manually mange this. Lambda function's event parameter contains the previous function(s) return output(s).
I have written a java class which hits the Azure REST API's and gets me the json response. for example below-
{
"value": [
{
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "Storage",
"id": "/subscriptions/cc60365e-3193-xxxx-b0f6-xxxxxxx/resourceGroups/WebServer-ubuntu/providers/Microsoft.Storage/storageAccounts/webserverubuntudiagxxx",
"name": "webserverubuntudiag4xx",
"type": "Microsoft.Storage/storageAccounts",
"location": "eastus",
"tags": {},
"properties": {
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"trustedDirectories": [
"50228742-xxx-4cd2-xxx-3e50b7a62xx1"
],
"supportsHttpsTrafficOnly": false,
"encryption": {
"services": {
"file": {
"enabled": true,
"lastEnabledTime": "2018-03-26T15:02:26.8078850Z"
},
"blob": {
"enabled": true,
"lastEnabledTime": "2018-03-26T15:02:26.8078850Z"
}
},
"keySource": "Microsoft.Storage"
},
"provisioningState": "Succeeded",
"creationTime": "2018-03-26T15:02:26.6359768Z",
"primaryEndpoints": {
"blob": "https://webserverubuntudiagxx.blob.core.windows.net/",
"queue": "https://webserverubuntudiag4xx.queue.core.windows.net/",
"table": "https://webserverubuntudiagxx.table.core.windows.net/",
"file": "https://webserverubuntudiag4xx.file.core.windows.net/"
},
"primaryLocation": "eastus",
"statusOfPrimary": "available"
}
}
]
}
My questions is: Are there any model/pojo/bean already available to map this json to java object ?
I need to map the data from above json into the java beans/pojos to display into jsp pages, do I need to separately create custom pojos or there are any already in Azure libraries/sdk ? any suggestions?
This is my jquery datatable ajax request... in success im getting the json data but in datatable its not showing ..its showing only loading..
<script type="text/javascript">
function inituserdatatable() {
alert("in");
try {
$('#userdetailDatatable').DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "ps/getUserDetails",
"type": "post",
"datatype": "json",
"success": function(data) {
},
},
"columns": [{
'data': 'name'
},
{
'data': 'email_id'
},
{
'data': 'user_name'
},
{
'data': 'password'
}
],
dom: 'Bfrtip',
});
} catch (exp) {
alert(exp);
}
}
</script>
This is my json data from postgresql
{
"data": [{
"id": 12,
"name": "",
"email_id": "",
"user_name": "",
"password": ""
}, {
"id": 13,
"name": "Ss",
"email_id": "sd",
"user_name": "g",
"password": "g"
}]
}
Remove the following processing and serverSide options, they are not needed based on your data format.
I've got the JSON data behind the scenes, that's it
[{"aid":100000,"name":"JYCM201609010250","rtsp":"947|100000|3750","statuz":"1","updateTime":"2017-05-31"},{"aid":100001,"name":"gui","rtsp":"947|100000|3750","statuz":"0","updateTime":"2017-05-31"}]
Background and foreground code are as follows
#Autowired
private MediaImpl media;
#ResponseBody
#RequestMapping(value = "/media",method = RequestMethod.GET)
public List<Media> MediaAll(){
System.out.println("------------------------------------------------------");
return media.findAll();
}
JS code is as follows
<script>
$(document).ready(function () {
$('#table_id_example').DataTable({
"iDisplayLength": 10,
"bLengthChange": false,
"ajax": {
"url": "/media",
"dataType": "json",
"success": function (json) {
console.log(json)
}
},
"columns": [
{
"data": 'aid'
},
{
"data": 'name'
},
{
"data": 'rtsp'
},
{
"data": 'statuz'
},
{
"data": 'updateTime'
}
]
});
});
html code is as follows
The console code
VM178:10 (2) [{…}, {…}]0: {aid: 100000, name: "JYCM201609010250", rtsp: "947|100000|3750", statuz: "1", updateTime: "2017-05-31"}1: {aid: 100001, name: "gui", rtsp: "947|100000|3750", statuz: "0", updateTime: "2017-05-31"}length: 2__proto__: Array(0)
There is no error in the front-end console, and no errors in the back end.But the data is not available
There are a couple of problems here. The first is that datatables expects data in a data element of the json response, such as:
{
data: [{"aid":100000,"name":"JYCM201609010250","rtsp":"947|100000|3750","statuz":"1","updateTime":"2017-05-31"},{"aid":100001,"name":"gui","rtsp":"947|100000|3750","statuz":"0","updateTime":"2017-05-31"}]
}
You should be able to use ajaxSrc: "" on your DataTable settings.
The second problem is with your ajax settings. DataTables states you can not supply the success callback in the ajax settings as it uses this internally.
Documentation on both of these issues:
https://datatables.net/reference/option/ajax
Assuming you are using DataTables 1.10.x
I am executing the following requests in elastic search through Chrome sense plugin:
DELETE /state
PUT /state
PUT /state/mapping/_mapping
{
"state" : {
"index_analyzer" : "angram",
"search_analyzer" : "standard",
"properties" : {
"stateName": {
"type" : "multi_field",
"fields": {
"stateName":{
"type":"string"
},
"untouched":{
"type" : "string","index" :"not_analyzed"
}
}
},
"countryName":
{
"type" : "multi_field",
"fields": {
"countryName":{
"type":"string"
},
"untouched":{
"type" : "string","index" :"not_analyzed"
}
}
}
}
}
}
DELETE /_river/state
PUT /_river/state/_meta
{
"type": "mongodb",
"mongodb": {
"db": "rakeshdb",
"collection": "state"
},
"index": {
"name": "state",
"type": "mapping"
}
}
I have to execute each DELETE and PUT request separately. Is there anyway to execute the complete script in a single shot.
No, the only thing you can do is merge the index creation with the put mapping call into a single create index call that contains the mappings too.
But you cannot delete an index and create one (even if another one) on the same request.