Showing 1 to 6 of 6 records
I want to update this.
for refresh the datatable I am using this in AJAX.
CODE
$("#myResourceData").load(location.href + " #myResourceData");
Related
I have a KendoUI grid with a column named "Status" :
Problem
Upon changing the value of a cell, I trigger the saving and update the grid with new data. The rows are updating but the status column is not re-rendering.
More details about the issue
The 1st row is the filter and the remainings are the actual rows.
Filter applied => Where status = Paid.
I've modified row 3 to set the status to "Not Paid".
I've triggered the Save to the backend database, then fetch all the rows where Status = Paid and then re-assign the new data to the kendo-grid.
Expected result
We have one less row in the table because the status of row 3 has changed.
All the rows in the table have "Paid" status.
Obtained result
One less row in the table. => Good
The row 4 before is now Row 3. => Good
The status of Row 3 (ex row 4) is still "Not Paid" even though in the data obtained it is "Paid". => Error
Additional notes
The html code for the column is below.
On cell value edit, the changes are saved in a dictionary on client side. When the client clicks on the save button, all changes are sent to the backend.
Assigning the new data to the kendo-grid
The table is bound to this variable which gets updated when there're new data.
<kendo-grid
[data]="this.dataAggregative.data"
...>
...
</kendo-grid>
The template for the column
<kendo-grid-column
[editable]="true"
field="status"
title="Status">
<ng-template kendoGridFilterCellTemplate let-filter>
<drop-down-list-filter
class="k-filtercell-wrapper"
[filter]="filter"
[data]="statusFilterEntries"
textField="text"
valueField="status">
</drop-down-list-filter>
</ng-template>
<ng-template kendoGridCellTemplate let-dataItem>
<div class="toolbar-container container">
<kendo-dropdownlist
[data]="statusFilterEntries"
textField="text"
valueField="status"
(selectionChange)="statusSelectionChange($event, dataItem.id)"
[value]="statusFilterEntries[dataItem.status == statusEnum.NotPaid ? 0 : 1]">
</kendo-dropdownlist>
</div>
</ng-template>
</kendo-grid-column>
Issue fixed by updating the model locally before pushing all the changes to the backend.
I use https://backpackforlaravel.com/
by default, it shows :
but i want applying it : Previous 1 2 3 4 5 ... 10 Next on all pages .
i don't see < or >. Thank you in advance
jQGrid datetime server side filter not working with specific date format
We have used Trirand.Web.UI.WebControls.JQGrid in our Asp.Net application, We have also enabled server side filtering setting LoadOnce = false. We have also implemented localization for Date format for that we are using below code
JQGridColumn jc = new JQGridColumn();
jc.DataFormatString = "{0:" + UserDateDisplayFormat + "}";
CustomFormatter jcformatter = new CustomFormatter();
jcformatter.FormatFunction = "FormatNullDateCellValue";
jc.Formatter.Add(jcformatter);
Where "FormatNullDateCellValue" JavaScript function is converting datetime format for display in grid.
Now we are facing issue with specific date format "dd-MM-yyyy" when date is lower then 12 (e.g. 10-02-2018).
For server side in Asp.Net we have jqGrid_DataRequesting method where we got filtered result with 1 record count.
But from there when code reaches to loadComplete(data) JavaScript method we found record count 1 but not row data.
This is strange from we have got so far http://www.trirand.net/forum/default.aspx?g=posts&t=3964 but this is not helping us.
Thanks in Advance.
I encountered a problem with pagination in my Laravel app.
Normally, when I want to use Laravel pagination with let's say 3 rows for one page, I use Eloquent method paginate/simplePaginate in combination with method latest() like so:
//MyController.php
$posts= Post->latest()->paginate(3);
//MyView.blade.php
#foreach ($posts as $post)
{{ $post->id }}
#endforeach
{{ $posts->links() }}
So when i have 6 posts in my database and I use Laravel pagination + Infinite scroll, that becomes:
6
5 (1. page)
4
--- ('page separator')
3
2 (2. page)
1
But, if user inserts new row into database table before I reach page 2,
the collection shifts and second page of data becomes:
6
5 (1. page)
4
--- POST WITH ID 4 IS DUPLICATED BECAUSE OF SHIFT IN COLLECTION
4
3 (2. page)
2
So, for example --- if user inserts three new rows into database before I reach paginator, then the second page will output the same three table rows as my current first page, but i'd like to output the remaining table rows:
6
5 (1. page)
4
--- AT SOME TIME BEFORE PAGINATION WAS TRIGGERED, POST WITH ID '7' HAS BEEN ADDED
3
2 (2. page) - continues normally with remaining rows (pagination ignores newly added row)
1
Is there any workaround for this problem?
Thanks.
I solved this issue by asking for the first record id of the first page served
// {initial query} $records->orderBy('created_at', 'desc');
if(is_int($last_id)){
$records = $records->where('id', '<=' , $last_id);
}
$records = $records->paginate($per_page);
This way, the paginator get's records starting from that id, ignoring new records
You could try this:
$posts= Post->orderBy('id', 'desc')
->distinct()
->paginate(3);
I am using a xforms:bind to do field validation for a year field. the code is at below:
<xforms:bind nodeset="instance('application-instance')/academic/cert_ordinary/year" level="year-1" constraint="if (string-length(.) < 1 ) then . = . else . castable as xs:integer and string-length(.) = 4 "/>
while the UI code is below:
<xforms:repeat ref="instance('application-instance')/academic/cert_as" id="cert-as-repeat">
<xforms:input ref="year" incremental="true" class="input_smaller">
<xforms:alert level="year-1">Must be 4 digit year!</xforms:alert>
</xforms:input>
</xforms:repeat>
the validation is working fine, but the problem is, when i add multiple row of data, the validation is not working if i insert some string into the year and then change it to number.
for example, after i put "test" for 3 rows of year, the alert will shown there but then i change it to "2014", the alert for 1 row will still remains there and wont go away.
is this a bug from orbeon? FYI i using the orbeon 4.2.
Thanks
seem like i made a mistake in the if statement
constraint="if (string-length(.) < 1 ) then true() else . castable as xs:integer and string-length(.) = 4"
this shd be the correct if statement.
thanks